Thursday, May 5, 2011

How to show a loading graphic while a file is getting uploaded?

The file should be uploaded in the background via Ajax or Iframes. I should be able to detect via javascript when the upload has completed, so I can hide the loading graphic and redirect the user to a new URL. Using Jquery is fine.

From stackoverflow
  • Check out jQuery Uploadify

    EDIT: There's also a similar question: how-to-upload-file-jquery - you could display the graphic after the upload button has been clicked and hide in the success/onerror function callback.

    Click Upvote : I'm having troubles getting Uploadify to work with CodeIgniter. It always gives me an I/O error. Do you know how to make it work with Codeigniter?
    Jose Basilio : I have't used it with CodeIgniter, but there are some posts on that: http://codeigniter.com/forums/viewthread/109751/#554977
  • The jquery Form Plugin is capiable of doing Ajax upload (using an iframe i believe). It won't help you out directly with showing/hiding an loading image, but it has the appropriate events so you know when the upload starts and finishes.

0 comments:

Post a Comment