meadhikari
meadhikari

Reputation: 1039

Base64 Image upload not working in iOS

I am building a phonegap application which requires image captured from camera to be uploaded to the server. I am using camera plugin to capture the image and sending the base64 string to the server.

This works fine in android but is causing problem in iOS. In iOS POST request is working fine in other instances where there is no image data involved. I have been using jquery to do handle the post requests.

I found one relevant discussion here talking about the memory usage. Can it be the reason behind this working in android but not in iOS? How do I reduce the memory usage and send the data at the same time.

Upvotes: 1

Views: 544

Answers (1)

Eldhose M Babu
Eldhose M Babu

Reputation: 14530

Its better to go for multipart file uploading rather than uploading the file as string. In android also it will fail, if the image size is high.

you need to use MultipartEntity for this in client side. Google for more info.

Upvotes: 1

Related Questions