I have a file upload control. When i upload any file, till the file being uploaded, i want to show "Loading..." below that control. is it possible using Javascript.
Asked
Active
Viewed 232 times
0
-
3Welcome to SO! Please read the [FAQ](http://stackoverflow.com/faq), especially the parts on what's an appropriate question to ask. The answer is yes. Please check with your neighborhood Google search page to find approaches and libraries/plugins. `:)` – Jared Farrish Jun 11 '12 at 06:07
-
There are plenty of JS / jQUery file upload controls that you can use that will give you that type of functionality. – Moin Zaman Jun 11 '12 at 06:09
-
possible duplicate of [How to show a loading graphic while a file is getting uploaded?](http://stackoverflow.com/questions/831761/how-to-show-a-loading-graphic-while-a-file-is-getting-uploaded) – Jared Farrish Jun 11 '12 at 06:10
-
One is here: http://valums.com/ajax-upload/ – Derek 朕會功夫 Jun 11 '12 at 06:10
-
A [smorgasbord](http://www.donotyet.com/2009/08/09/the-ultimate-collections-of-ajax-file-upload-plugins/) of libraries. Not a plethora, just a buffet of options. And that page is three years old. – Jared Farrish Jun 11 '12 at 06:15
1 Answers
0
You can use this JavaScript library:
http://valums.com/ajax-upload/
It has:
onSubmit: function(id, fileName){},
onProgress: function(id, fileName, loaded, total){},
onComplete: function(id, fileName, responseJSON){},
onCancel: function(id, fileName){},
enough for you to know the status of the file.
It is cross browser capable.
This plugin uses XHR for uploading multiple files with progress-bar in FF3.6+, Safari4+, Chrome and falls back to hidden iframe based upload in other browsers, providing good user experience everywhere.

Derek 朕會功夫
- 92,235
- 44
- 185
- 247
-
Don't you need the back-end to support progress update in order to display progress bar? – Aleks G Jun 11 '12 at 06:13
-
There's no "right" answer to this question, other than "Yes it is possible." In a monotone voice. So there's no way to say any one or the other library will/can/should/is anything other than an option. 21 views and two close votes, with many duplicate questions. Mm mmm. – Jared Farrish Jun 11 '12 at 06:21