Showing progress with the Safari 4 multiple file upload

Andrea Giammarchi has taken the new Safari 4 implementation of multi input file upload functionality and has written an article on how to write the client and server to enable this.He shares the new XHR implementation:


  1. var xhr = new XMLHttpRequest,
  2. upload = xhr.upload;
  3. upload.onload = function(){
  4. console.log("Data fully sent");
  5. };
  6. xhr.open("post", page, true);
  7. xhr.send(binaryData);

and the delves into a PHP server backend that groks things like X-File-Size and X-File-Name.

Then, he shows the client side code to push this all forward and packages it all up:

If you have better solution, just tell me !

0 comments: