I've set a ondrop event on my drop area and it receives an event when I drag an image from my desktop to the drop area.
However, according to the Recommended_Drag_Types document:
https://developer.mozilla.org/en/DragDrop/Recommended_Drag_Types
A local file is dragged using the application/x-moz-file type with a data value that is an nsIFile object. Non-privileged web pages are not able to retrieve or modify data of this type.
That makes sense, but how do I prompt the user to escalate privileges to get access to the file data and send it via an XMLHttpRequest
?
If I try it without escalating privileges when I do this code:
event.dataTransfer.mozSetDataAt("application/x-moz-file", file, 0);
Javascript returns this error:
Permission denied for domain.com to create wrapper for object of class UnnamedClass
The only article I can find on this is one from 2005 but I can't tell if the directions still apply to Firefox 3, it suggest doing this:
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
which doesn't seem to work.