views:

17

answers:

1

Can you get the binary data from a file without the fileReader class? I'm trying to upload files and I have it working in firefox & chrome/webkit but safari 5 doesn't have filereader.

There has to be a way to get the binary data as gmail has drag and drop that works in safari 5.

A: 

I worked it out, thanks to the demo here: http://webreflection.blogspot.com/2009/03/safari-4-multiple-upload-with-progress.html

I just need to feed the dataTransfer File...

var file = e.dataTransfer.files[0];

var xhr = new XMLHttpRequest();

xhr.open("POST", "upload_process.php", true);

xhr.send(file); //passing in file object seems to work
Castles