Page 2 of 3

how to post camera photo file to parse.com?

Posted: Fri Apr 27, 2012 12:15 am
by maxkatz

how to post camera photo file to parse.com?

Posted: Sun Apr 29, 2012 7:29 pm
by Gail

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.


how to post camera photo file to parse.com?

Posted: Sun Apr 29, 2012 9:27 pm
by maxkatz

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


how to post camera photo file to parse.com?

Posted: Fri Oct 19, 2012 12:01 pm
by Clinton

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?


how to post camera photo file to parse.com?

Posted: Fri Oct 19, 2012 1:30 pm
by maxkatz

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.


how to post camera photo file to parse.com?

Posted: Fri Oct 19, 2012 1:37 pm
by Clinton

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?


how to post camera photo file to parse.com?

Posted: Fri Oct 19, 2012 1:52 pm
by Maryna Brodina

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


how to post camera photo file to parse.com?

Posted: Fri Oct 19, 2012 2:01 pm
by Clinton

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


how to post camera photo file to parse.com?

Posted: Fri Oct 19, 2012 3:13 pm
by Clinton

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


how to post camera photo file to parse.com?

Posted: Fri Oct 19, 2012 4:12 pm
by Clinton

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