How to upload multipart form data and image to server in android?

后端 未结 6 554
醉梦人生
醉梦人生 2020-11-29 04:39

Status code 500 during upload multipart entity image to server in android code

Html form: (can add successfully image to server)

          


        
6条回答
  •  广开言路
    2020-11-29 05:38

    Try this may help you

    File file = new File(Environment.getExternalStoragePublicDirectory(
                            Environment.DIRECTORY_DCIM).toString()
                            + "/Camera/Test.jpg");
                    entity.addPart("picture", new FileBody(file,"image/jpg")); //Update here
    

提交回复
热议问题