Hi guys,
I've got this very strange error and I don't know how to deal with it. My setup is a page in which I can select one image file, (gears beta.desktop) and then it should upload. But it doesn't upload, and gives a very strange error which I can't get away. below is my code:
var filesToUpload = null;
function progressEvent(event) {
var bar = $("#progressBar");
var percentage = Math.round((event.loaded / event.total) * 100);
bar.width(percentage + '%');
}
function uploadState() {
if(request.readyState == 4) {
if(request.status != 200) {
alert('ERROR');
} else {
alert('DONE');
}
}
}
function handleFiles(files) {
if(files.length) {
$('#loader').slideDown(500);
var curFile = files[0];
request.open('POST', 'upload.php');
request.setRequestHeader("Content-Disposition", "attachment; filename=\"" + curFile.name + "\"");
request.onreadystatechange = uploadState;
request.upload.onprogress = progressEvent;
request.send(curFile.blob);
}
}
init = function() {
if(!window.google || !google.gears) {
$('body').css('background', 'white');
$('#gearsOn').hide();
$('#gearsOff').show();
return;
}
// verberg 'geen gears' bericht
$('#gearsOff').hide();
// init upload zooi (gears)
desktop = google.gears.factory.create('beta.desktop');
request = google.gears.factory.create('beta.httprequest');
// on click funct
$('#titel').click(function() {
var newtitle = prompt("Voer een titel in voor het album.");
if(newtitle != '' && newtitle != null) {
$(this).text(newtitle);
}
});
$('.addPictures').click(function() {
filesToUpload = null;
var options = { singleFile: true, filter: [ 'image/jpeg', 'image/png'] };
desktop.openFiles(handleFiles, options);
});
};
$(document).ready(init);
It gives the following error:
[Exception... "Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsILoadGroup.groupObserver]" nsresult: "0x80004001 (NS_ERROR_NOT_IMPLEMENTED)" location: "JS frame :: file:///Users/Fabian/Library/Application%20Support/Firefox/Profiles/oo132cjy.default/extensions/%7Be3f6c2cc-d8db-498c-af6c-499fb211db97%7D/components/componentCollectorService.js :: anonymous :: line 1155" data: no]
[Break on this error] obj = getIface(request.loadGroup.groupObserver);
The thing is visible at this location: Dynamics Photo
Thanks in advance!!