1

I was working on a little app and I was trying to upload images to Parse. These images are taken with camera using the cordova camera plugin (I am using ngCordova). Well my question is, the camera plugin can return the image in base64 or an url. I've read that is not a good practice manipulating base64 encoded images because this leads to memory problems. The alternative I think was using Cordova File Transfer plugin but the problem is Parse does not support "multipart/form-data". So, What method should I use to upload images to Parse? I also thought of using Javascript Parse SDK which lets me upload files in base64 but I am still concern of memory leaks.

Thanks you all very much

NMO
  • 293
  • 1
  • 10
  • https://www.parse.com/questions/upload-image-with-phonegap – NMO May 26 '15 at 15:55
  • https://www.parse.com/docs/rest/guide#files-uploading-files – NMO May 26 '15 at 15:55
  • This one is quite significant -> http://stackoverflow.com/questions/28843883/append-image-file-to-form-data-cordova-angular – NMO May 26 '15 at 16:11
  • "I've read that is not a good practice manipulating base64 encoded images because this leads to memory problems" - do you have a link for this? Is the memory issue a phonegap issue? – Aaron Saunders May 26 '15 at 22:55

1 Answers1

0

You can probably set chunkedMode on the file transfer plugin to false to avoid multipart being sent. The problem is that then you've still got to read the whole thing into memory in order to send it and you won't be able to get the progress callback. I don't know if this matters but it should help to get around the restriction.

JimTheDev
  • 3,469
  • 1
  • 23
  • 26