如何android在中使用springMvc实现图片上传功能-创新互联

本篇文章为大家展示了如何android在中使用springMvc实现图片上传功能,内容简明扼要并且容易理解,绝对能使你眼前一亮,通过这篇文章的详细介绍希望你能有所收获。

在温江等地区,都构建了全面的区域性战略布局,加强发展的系统性、市场前瞻性、产品创新能力,以专注、极致的服务理念,为客户提供成都网站制作、成都网站设计、外贸营销网站建设 网站设计制作按需网站开发,公司网站建设,企业网站建设,品牌网站制作,全网营销推广,成都外贸网站建设公司,温江网站建设费用合理。

具体内容如下

Android端:

String fileName = tvFilename.getText().toString();
 RequestBody description =
  RequestBody.create(
   okhttp3.MultipartBody.FORM, fileName);

 File fileImage = new File(saveFileName);
 RequestBody requestBody1 =
  RequestBody.create(MediaType.parse("multipart/form-data"), fileImage);
 MultipartBody.Part body =
  MultipartBody.Part.createFormData("bannerImage", fileImage.getName(), requestBody1);


 RestClient.api().addLive(description, body)
 .enqueue(new retrofit2.Callback() {
  @Override
  public void onResponse(retrofit2.Call call, retrofit2.Response response) {
  "处理成功"
  }

  @Override
  public void onFailure(retrofit2.Call call, Throwable t) {
  "处理失败"
  }
 });

本文题目:如何android在中使用springMvc实现图片上传功能-创新互联
当前网址:http://csdahua.cn/article/joice.html
扫二维码与项目经理沟通

我们在微信上24小时期待你的声音

解答本文疑问/技术咨询/运营咨询/技术建议/互联网交流