This is a migrated thread and some comments may be shown as answers.

Cannot send large data like base64 image string using JsonP

2 Answers 323 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Gaja
Top achievements
Rank 1
Gaja asked on 06 Aug 2013, 12:57 PM
Hi All,

I am trying to save the image captured from the camera to the database, i am using Jquery Ajax call with JSONP,  when the image data is very large the request is not caught by the webservice on the server side . I have researched a lot on this changing the maximum request length and maxjsonlength values in the web config, but still i found no solution for this . Also i came across a post saying to send the data in packets but the implementation part was not mentioned in the post.   Please someone guide me on this as it is has taken a lot of time already.

Thanks

Gaja Naik

2 Answers, 1 is accepted

Sort by
0
Accepted
Steve
Telerik team
answered on 08 Aug 2013, 04:00 PM
Hi Gaja,

The provided information is insufficient to determine what might be the culprit, and it could be quite a few things. For example according to the Cordova Camera API docs,

Note: The image quality of pictures taken using the camera on newer devices is quite good ...Encoding such images using Base64 has caused memory issues on many newer devices. Therefore, using FILE_URI as the 'Camera.destinationType' is highly recommended.

i.e. it is likely your phone runs out of memory and never sends the request. You can setup Fiddler to intercept your device's traffic and give you a clue what's going on by reviewing the requests/responses. You could also use the sample code from the API and specify FILE_URI as destinationType instead.

You could also check whether your "transfer" implementation is correct by checking out the following articles:

The FileUploadOptions of the FileTransfer Cordova object supports chunkedMode.

Regards,
Steve
Telerik

Do you enjoy Icenium? Vote for it as your favorite new product here (use short code H048S).
Looking for tips & tricks directly from the Icenium team? Check out our blog!
Share feedback and vote for features on our Feedback Portal.
0
Gaja
Top achievements
Rank 1
answered on 28 Aug 2013, 10:06 AM
Hi Steve,

I followed the Fileupload method , the solution worked . Thanks..

Gaja
Tags
General Discussions
Asked by
Gaja
Top achievements
Rank 1
Answers by
Steve
Telerik team
Gaja
Top achievements
Rank 1
Share this question
or