Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gmail like file upload with jQuery

Tags:

I would like to upload files just like google mail does. I would want to use jQuery and PHP to do it is there anyway of getting the progressbar etc.?

Here I added a video of how google does it. http://dl.getdropbox.com/u/5910/Jing/2009-04-02_1948.swf

No flash, no perl or cgi please..

I guess I can live without the progressbar now I am actually searching for information about jquery plugins or just what things I would need to look at

like image 904
Thomaschaaf Avatar asked Apr 02 '09 17:04

Thomaschaaf


2 Answers

It is weird that people say that gmail doesn't use flash, when you can plainly see the swf file in the gmail interface. Try right clicking on "Attach a file". It is what allows the multiple uploads at once among other things.

like image 156
Jake Avatar answered Oct 19 '22 06:10

Jake


The easiest would be to use SWFUpload, it's a small button written in Flash, with all the hooks to drive it in JS. Very easy to use and works well with PHP

but, if you really want it to be pure JS, you'll need some help from the server. specifically, you'll need to start the upload, and periodically query the server about how's it going. unfortunately, PHP upload handling doesn't get any notification until after the download finishes. you'd have to replace it with something else. there are a few pure JS uploaders that include sample Perl server code just because of that.

IOW: JS and PHP don't (fully) cut it. either add flash to the client, or a better upload handler at the server.

like image 38
Javier Avatar answered Oct 19 '22 05:10

Javier