Cannot send large data like base64 image string using JsonP

3 posts, 1 answers
  1. Gaja
    Gaja avatar
    12 posts
    Member since:
    Oct 2007

    Posted 06 Aug 2013 Link to this post

    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.


    Gaja Naik
  2. Answer
    Steve avatar
    10941 posts

    Posted 08 Aug 2013 Link to this post

    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.


    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.
  3. Gaja
    Gaja avatar
    12 posts
    Member since:
    Oct 2007

    Posted 28 Aug 2013 Link to this post

    Hi Steve,

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

Back to Top