This question is locked. New answers and comments are not allowed.
we want to have a feature where the user takes a photo and then that photo is sent to a web service to be stored.
We are using:
function cameraApp () {};
cameraApp.prototype={
_pictureSource: null,
_destinationType: null,
........
to get the picture. We can get: destinationType: cameraApp._destinationType.FILE_URI,
or: destinationType: cameraApp._destinationType.DATA_URL
That works great. We display the output in an IMG tag, either way. The issues all seem to be with the sending part.. We tried: ft.upload(imageURI, encodeURI("http://service.etc.etc/etc/service"), win, fail, options);
with any number of different configurations, etc. It doesn't do anything. It returns error code 1 or 3, and has never reached the server or returned the service response.
we tried passing the URI along to let the service to let it access the file, but then we have all kinds of issues about unable to resolve URI, etc.
this:
var formData = new FormData();
formData.append("myfile", blob, imagefilename);
var request = new XMLHttpRequest();
request.open("POST", "http://service..etc.etcetc");
request.send(formData);
works perfectly, just - not on any mobile devices. works great in the simulator, but thats it.
We seem to be running out of ideas. Obviously, any number of mobile apps have this capability. So, what have others done successfully? This seems like it ought to be simple.
We are using:
function cameraApp () {};
cameraApp.prototype={
_pictureSource: null,
_destinationType: null,
........
to get the picture. We can get: destinationType: cameraApp._destinationType.FILE_URI,
or: destinationType: cameraApp._destinationType.DATA_URL
That works great. We display the output in an IMG tag, either way. The issues all seem to be with the sending part.. We tried: ft.upload(imageURI, encodeURI("http://service.etc.etc/etc/service"), win, fail, options);
with any number of different configurations, etc. It doesn't do anything. It returns error code 1 or 3, and has never reached the server or returned the service response.
we tried passing the URI along to let the service to let it access the file, but then we have all kinds of issues about unable to resolve URI, etc.
this:
var formData = new FormData();
formData.append("myfile", blob, imagefilename);
var request = new XMLHttpRequest();
request.open("POST", "http://service..etc.etcetc");
request.send(formData);
works perfectly, just - not on any mobile devices. works great in the simulator, but thats it.
We seem to be running out of ideas. Obviously, any number of mobile apps have this capability. So, what have others done successfully? This seems like it ought to be simple.