6 Replies Latest reply on Jul 15, 2013 11:20 PM by Mark Nongkhlaw

    Any way to do image upload thru AsyncHTTP to populate backend database field?

    Mark Nongkhlaw

      My backend is a PostgreSQL database, and in a table, there is an image field which stores images/photos in binary format.

       

      The requirement is to take a picture using the mobile device camera, store it in the device when offline and then whenever its online again, upload it in such a way as to populate that image field in the backend thru AsyncHTTP.

       

      But JSON webservice does not support binary data, so how to go about it? I know that the binary image could be encoded into a Base64 string before sending it to the webservice, but how to decode it back into binary before populating the backend database. Storing it as a Base64 string might bloat the database. In fact, is it even possible to populate the database field directly, or would the file have to be uploaded on the server's filesystem instead?

       

      Any tips/sample app/code snippets would be of great help.

       

      Thanks.