0

Hi All,

I am using php to create a Webservice API calls.
I am checking all the service calls in Chrome's Postman and sending the data in JSON format.
I want to upload an image in JSON format with other datas.Actually I have converted the image to base64 before uploading.Its working fine.But I have found in some posts , there may be a chance of data loss if we upload High definition images.

I want to know that is there any other way to upload images as JSON in postman.

3
Contributors
3
Replies
14
Views
2 Years
Discussion Span
Last Post by cereal
1

Hi,

data loss means a file corruption because the server misses some packets from the transmission (for example caused by a timeout), in this case the uploaded file will result corrupted and the server will return an error because the received length is not the same of what was declared by the Content-Length header. So in this case the API should return an error code.

This does not depend on JSON, depends on the HTTP protocol.

Or you mean that the service will reduce compress high-res files? I now that Picasa does something similar with free accounts.

Edited by cereal

0

While this does not solve your question, compressing the base64 string might reduce errors caused by timeout of big files transfer.
Note that because base64 is string then your problem isn't JSON but how to reliably post big data!

That being said, make sure that your server supports image data max size limit. I would accept json field telling me of data size and send error if that size exceeds my limit.

http://stackoverflow.com/questions/22329481/compressing-base64-data-uri-images

0

Just an update to my previous post (besides I think I got a downvote for this typo haha): I wrote about Google Picasa but I intended Google Photos, which has two storage types: High Quality and Original, the first type will reduce the size of images bigger than 16MP (mega pixels):

If the camera takes photos with a resolution higher than 16 MP, then photos will be downsized to 16 MP.

the second won't reduce the images, but free storage is limited. Source:

Sorry for that, bye! :)

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.