taucher
Posts: 0
Joined: Fri Apr 17, 2015 6:06 am

Camera to Parse Database

Hello,

I get the picture by camera service (Image Uri, jpg) and i can get the URL of the image path. But when i try to upload the file to Parse with post Rest Api (request content type= data). The service creates a image file on Parse with no data.

Why is this so hard to send a image to Parse? Does anyone have a solution?

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

Camera to Parse Database

Hello Taucher,

Please show us your service settings screen shot.
Provide us with all possible details.

taucher
Posts: 0
Joined: Fri Apr 17, 2015 6:06 am

Camera to Parse Database

Hello Alena,

I solved it by this way :

Parse Post Service Settings :
In the rest service request body data , i write code{"base64":"{base64}","_ContentType":"image/jpeg" }/code.

Header:
Content-Type : text/plain

Parse Post URL: .../files/picture.jpg

Camera:
The camera service request is dataURL. Then save it to "image_base64" local storage.

Before invoke service:
code
var data = localStorage.getItem("image_base64");
data = data.substring(data.indexOf(',')+1);

FileUpload_settings.base64 = data;
/code.

This is working but not the proper way. Proper way is : Content-Type: image/jpeg and "@" before filename and send as binary file.

taucher
Posts: 0
Joined: Fri Apr 17, 2015 6:06 am

Camera to Parse Database

But Alena,

My new problem is how can i send a document file(pdf,doc) to Parse database? (Android - IOS)

I try with file input component and use "uploadMultipleFilesHelper" to post the data to the parse database. But parse needs to write the filename in url. When i write the filename to the url i get this error "This data source not be supported in the method of upload multiple files".

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Camera to Parse Database

Hello,

You should send data as it is needed on parse database. E.g. it can be attachment as described here (using Blob):
http://blog.bismallion.com/appery-sen...

Return to “Issues”