remy/html5demos — Issue #26: File D&D actually works on safari
Author: uuf6429
Created: 2011-12-19 11:02:14+00:00
State: open

A website of mine uses file D&D API for uploads, and it works on Safari.

In short, the code for this to happen looks like:

onFilesDropped = function(event){
var file = event..dataTransfer.files[0]; // there is always at least one file in such an event
var form = new gFormData(); // see https://github.com/gkoberger/Global-FormData
form.append('Filedata', file);
// you would want to listen to events in form.xhr for upload progress etc...
form.send();
}

The test itself is misleading. It is testing file access and file d&d at the same time.