0

Please share, if its possible to post an image to web server without using MultipartEntity class.

Previously, i followed this tutorial https://vikaskanani.wordpress.com/2011/01/29/android-image-upload-activity/ for post an image in server. May i know possible ways to post image other than this method.

Narendra Singh
  • 3,990
  • 5
  • 37
  • 78
Aerrow
  • 12,086
  • 10
  • 56
  • 90
  • 2
    convert the image to a base64 string and post it – Triode May 06 '15 at 07:14
  • 1
    @Triode,Yes it is a alternative but have to scale large image before get Base64 String. – Haresh Chhelana May 06 '15 at 07:15
  • check this link http://stackoverflow.com/questions/20322528/uploading-images-to-server-android – Jignesh Jain May 06 '15 at 07:17
  • You did not tell why you don't wanna use MultipartEntity. It is deprecated now. You could use MultipartEntityBuilder. There still are other ways. – greenapps May 06 '15 at 07:54
  • `Yes it is a alternative` ?? No that is no alternative as poster did not tell what to use instead of MultipartEntity. If one does not use MultipartEntity one could also better post the image not base64 encoded. – greenapps May 06 '15 at 07:57

1 Answers1

0

If you use HttpURLConnection you can directly write your data to the output stream.

greenapps
  • 11,154
  • 2
  • 16
  • 19