简体   繁体   中英

Uploading a file and getting the uploaded percentage in MVC and JQuery

I am developing a file upload feature in MVC4 with a jquery progress bar.

I have done the file uploading part. What I need to do next is find uploaded data size during uploading and use that value to populate the progress bar.

How can I get uploaded data size during uploading a file?

I am not expecting a whole block of code for the complete file upload. What I need is a reference or a code block, on how to get the uploaded data size. I have used c# for my application.

I have found the following link. You need to use the XMLHttpRequest object to periodically check the progress and update the progress bar values. I have not yet done the coding for this, but will update once its done.

https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/Using_XMLHttpRequest?redirectlocale=en-US&redirectslug=DOM%2FXMLHttpRequest%2FUsing_XMLHttpRequest

Thanks,

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM