Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to implement gmail like file upload/attachment using HTML 5

I remember some options where Ajax like(No post back world) file upload was supported,

  1. Hidden iframe
  2. Using flash object (Though i still have curiosity of why SWF is used ? and what advantages it offer ?)

However by looking at blogs it appears that HTML 5 is promising, i tried some small examples and it really works :)

But recently i found that gmail has new drap drop file feature implemented using the HTML 5 (No flash). Can some one guide me how this can be achieved and what all i need to prepare ? Is there change in XMLHTTP...(Ajax object) api in HTML 5 ? Any threads will be helpful thanks all,

like image 474
Anil Namde Avatar asked Aug 19 '10 13:08

Anil Namde


1 Answers

I could be wrong, but I think the only help that HTML5 gives for such an upload-pattern is that it supports the attribute 'multiple' for upload fields. This allows you to select multiple files from the file-chooser dialog without using flash . The uploading itself still has to be done by JS or PHP or [yourfavorite]. A nice helper could be

http://code.google.com/p/jquery-html5-upload/

for example.

like image 97
benzimmer Avatar answered Oct 02 '22 23:10

benzimmer