开发者

Sending an image from an application to a webserver

开发者 https://www.devze.com 2023-04-03 07:36 出处:网络
I was wondering what the preferred way of sending an image to a webserver from an android application?

I was wondering what the preferred way of sending an image to a webserver from an android application?

I开发者_JAVA百科've seen people

  • opening up sockets and send the actual image data.
  • base64 encoding it and sending it as a string.

What is the preferred way? Can someone post some examples as well.

Thanks


You could try writing it to an xml file as a base64 string then send it an parse the file on the server and decode the string to an image.


An HTTP Post is probably the easiest way, sending it as multi-part form data. Makes it easier to receive as well (a bog standard web server can handle it!)

0

精彩评论

暂无评论...
验证码 换一张
取 消