Gail
Posts: 0
Joined: Tue Mar 06, 2012 12:34 am

how to post camera photo file to parse.com?

This is great! Although I think there might be a step missing. I don't see anything that mentions how to call the Select File function from a Click event on the Select File button.

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

how to post camera photo file to parse.com?

Updated. You need to add this code on button click:
$('#fileselect').trigger('click');

Clinton
Posts: 0
Joined: Thu Oct 18, 2012 11:03 am

how to post camera photo file to parse.com?

I followed the example. Looks great and works when I test on a PC. However, when I test on my mobile device from the Tiggzi Android app it does not open a file explorer or gallery or anything. Is there perhaps a work around for this?

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

how to post camera photo file to parse.com?

The app should work on Mobile Safari or Mobile Firefox, I think also Chrome (mobile) -- as those are the browsers that support the File API used in the example. It will not work yet as a hybrid app.

Clinton
Posts: 0
Joined: Thu Oct 18, 2012 11:03 am

how to post camera photo file to parse.com?

So is there no way of doing this kind of thing in an app environment? I see there is the camera service but I can't find a tutorial to use it. Will this maybe work?

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

how to post camera photo file to parse.com?

Hello! Is this what are you looking for http://help.gotiggr.com/documentation...?

Clinton
Posts: 0
Joined: Thu Oct 18, 2012 11:03 am

how to post camera photo file to parse.com?

Great! Thats what I was looking for. Seems to work! Should be able to send a base64 to my Parse DB. Thanks!

Clinton
Posts: 0
Joined: Thu Oct 18, 2012 11:03 am

how to post camera photo file to parse.com?

Ok I'm having a boat load of trouble with the base64

1) I'm not sure what my type should be for my base64 field in my class.

2) Not sure how to send it along with normal text. I'm not sure about the javascript. Nothing I tried works. This was my latest attempt.

precode
curl -X POST \
-H "X-Parse-Application-Id: my key" \
-H "X-Parse-REST-API-Key: my key" \
-H "Content-Type: application/json" \
-d '{"name":"Jerry","image64":{"__type":"Bytes","base64":"some base64 formatted data"}}' \
https://api.parse.com/1/classes/MyClass
/code/pre

Clinton
Posts: 0
Joined: Thu Oct 18, 2012 11:03 am

how to post camera photo file to parse.com?

This also won't work

precode
var beerService = new Tiggr.RestService({
'url': 'https://api.parse.com/1/classes/beer',
'dataType': 'json',
'type': 'post',
'contentType': 'application/json',
});
var abeername = localStorage.getItem('beername');
var abeer64 = localStorage.getItem('img64');

var datasources = [];
restservice12 = new Tiggr.DataSource(beerService, {
'onComplete': function(jqXHR, textStatus) {
$t.refreshScreenFormElements("j_48");
},
'onSuccess': function(data) {},
'onError': function(jqXHR, textStatus, errorThrown) {},
'responseMapping': [],
'requestMapping': [{
'PATH': ['X-Parse-Application-Id'],
'HEADER': true,
'ATTR': 'mykey'
}, {
'PATH': ['X-Parse-REST-API-Key'],
'HEADER': true,
'ATTR': 'mykey'
}, {
'PATH': ['name'],
'ID': abeername,
'ATTR': 'value'
}, {
'PATH': ['img'],
'__type': 'Bytes',
'base64': abeer64
}]
});
datasources.push(restservice12);
/code/pre

Return to “Issues”