14 Comments to “Upload Files Like Gmail”

  1. Rochak Chauhan

    Dec 11th, 2007

    AJAX is very handy and effective tool for any Rich Web Application. However it has few limitations too:

    1) It can not make a remote call to another server.
    2) It can not post anything to the server other than text.

    But don’t let this effect you ! All this can still be done with a little work around.

    For more details: http://www.rochakchauhan.com

  2. Victor

    Apr 9th, 2008

    I have soe problem about upload file in hidden iframe, would you pls give me some suggestion????

    I have make a form and submit it through AJAX, and everything is work. And now I would like to provide a file upload function. I would like to keep my form submit in AJAX way, but file upload must upload through form.submit().

    The problem is when I use ajax to post a form while the file is still under uploading, the ajax request would ignore the file upload. So what can I do to make it wait untill the file is fully upload?

  3. Sajith M.R

    Apr 9th, 2008

    XMLHTTP Request does not support multipart data. So upto now (April 2008) there is no file uploading via ajax is possible. And form javascript , you can get the intermediate information of a file uploading. So mere javascript cant create a progress bar or anything with this file uploading. You can use applet or some activeX script for this purpose. Then what you can do with ajax is after uploading , you can make the needful changes.

  4. Nishant Mittal

    May 23rd, 2008

    Sajith, Excellent articles. I like the step by step writing style.
    One interesting thing about GMAIL file upload is that it handles the browser’s back button elegantly. Most Iframe based file upload solutions create an entry into the browsers history (BACK/FORWARD button). IE is very easy to trick but Opera is very unforgiving. GMAIL however works fine even with OPera. I dont know how they manage to do it. do you?

  5. cc

    Aug 18th, 2008

    I test your script and I meet the following :
    - as far the input point to hiddenframe how I will escape from form using html redirect tag ? – other suggestion ?
    Thanks.

  6. Sudhin

    Oct 6th, 2008

    I tried with your script and reach almost to the target…..i think i can..

  7. uchup

    Dec 11th, 2008

    hmm.. i still do not understand about use ajax..

  8. Jamie

    Feb 22nd, 2009

    Thanks for this. Just one thing: it would be handy for non-Windows users if you could put up future downloads in a more conventional compression format, e.g. zip. (OS X users: download something like UnRarX to open this file).

  9. saul

    Mar 13th, 2009

    very simple and usefull
    going to join it on my code igniter project
    great job

  10. manish

    Jun 3rd, 2009

    it ir realy gud yar.
    gr8 work

  11. [...] Gmails file uploading is another interesting thing. I already posted ajax file uploading : http://www.sajithmr.com/upload-files-like-gmail/ [...]

  12. Malik

    Jul 20th, 2009

    I want to upload pics and other videos on my gmail account. Can I do that, if yes then how I can do that…
    If anyone knows then let me know…
    Thanks

  13. James

    Sep 29th, 2009

    Another great example is here:
    Web Framework

  14. Will

    Feb 5th, 2010

    Fabulous! Makes my life easy compared to Every other script out there I found that tries to do this same thing and ends up being like 1000 lines long.


Leave a Reply