Hi. I'm trying to upload a photo taken by the camera to sharefile. I've been digging through all the documents etc i can find including this thread: https://getsatisfaction.com/apperyio/...
and as a result I'm able to upload a file. The problem is the file is unusable. When I try to open it with windows photo viewer it says its damaged corrupted or too large..
The javascript I'm using is and you can see based on the one in the link above (UploadfromCamera):
function FileUpload() {
var serverUrl = localStorage.getItem('locURL') + '&filename=' + encodeURIComponent(getFileName());
var imageDataBase64 = localStorage.getItem('locImage');
var rawdata = Base64.decode(imageDataBase64);
alert(serverUrl);
$.ajax({
type: "POST",
beforeSend: function(request) {
request.setRequestHeader("Content-Type", "image/jpeg");
},
url: serverUrl,
data: rawdata,
processData: false,
contentType: false,
success: function(data) {
alert("Upload successful");
},
error: function(data) {
// do something in case of an error...
alert(data.responseText);
}
});
}
Any ideas will be greatly appreciated.