locked
File Upload Progress with Percentage and Bytes RRS feed

  • Question

  • User-501986667 posted

    hi..

    during file upload process, i want to display progress bar with percentage completed and number of bytes.

    can we achieve this, in asp.net mvc 3

    Sunday, August 21, 2011 2:03 PM

Answers

  • User1682618242 posted

    You cannot do that unless you use a plugin Flash/Silverlight/Java Applet/ActiveX. For security reasons ajax / javascript isn't allowed to access the file stream or file properties before or during upload.

    You can try with the new HTML5 File Api but there is no full support yet:

    http://html5demos.com/file-api

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, August 21, 2011 3:48 PM
  • User401360897 posted

    http://t.wits.sg/misc/jQueryProgressBar/demo.php

    http://aquantum-demo.appspot.com/file-upload

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, August 22, 2011 1:24 PM
  • User-474980206 posted

    i need it with mvc  asynccontroller and ajax.

    not with flash.

    any ideas???

    if flash is out, then you will need to do the iframe trick. do the file post in an iframe. you will need to write a custom httphandler on the server to recieve the file, as the standard reads the posted file into a buffer before the controller is called. the client should send a guid with the posted file. client side after the iframe post, it starts to poll the server for the progess which it will display.

    you can get a jquery plugin fileupload has most of the client code, and will do what you want for safari and chrome, but if you need IE < version 10 support, then you need to write the http handler, do the polling and call the plugins onprogess.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, August 22, 2011 2:52 PM
  • User-1280676833 posted

    Hi anweshkumar,

    I think Valums Uploader meets your requirements. You can refer to it from here:

    http://valums.com/ajax-upload/

    Hope this helpful

    Regards

    Young Yang

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, August 26, 2011 2:59 AM

All replies

  • User1682618242 posted

    Not directly but with the help of a jQuery plugin you can do it:

    htttp://www.uploadify.com is one of them

    Sunday, August 21, 2011 2:22 PM
  • User197322208 posted

    with flash:

    http://blog.codeville.net/2008/11/24/jquery-ajax-uploader-plugin-with-progress-bar/

    (intercepting flow on browser is not something trivial ...)

    Sunday, August 21, 2011 2:24 PM
  • User-501986667 posted

    i need it with mvc  asynccontroller and ajax.

    not with flash.

    any ideas???

    Sunday, August 21, 2011 2:32 PM
  • User1682618242 posted

    You cannot do that unless you use a plugin Flash/Silverlight/Java Applet/ActiveX. For security reasons ajax / javascript isn't allowed to access the file stream or file properties before or during upload.

    You can try with the new HTML5 File Api but there is no full support yet:

    http://html5demos.com/file-api

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, August 21, 2011 3:48 PM
  • User401360897 posted

    http://t.wits.sg/misc/jQueryProgressBar/demo.php

    http://aquantum-demo.appspot.com/file-upload

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, August 22, 2011 1:24 PM
  • User-474980206 posted

    i need it with mvc  asynccontroller and ajax.

    not with flash.

    any ideas???

    if flash is out, then you will need to do the iframe trick. do the file post in an iframe. you will need to write a custom httphandler on the server to recieve the file, as the standard reads the posted file into a buffer before the controller is called. the client should send a guid with the posted file. client side after the iframe post, it starts to poll the server for the progess which it will display.

    you can get a jquery plugin fileupload has most of the client code, and will do what you want for safari and chrome, but if you need IE < version 10 support, then you need to write the http handler, do the polling and call the plugins onprogess.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, August 22, 2011 2:52 PM
  • User-1280676833 posted

    Hi anweshkumar,

    I think Valums Uploader meets your requirements. You can refer to it from here:

    http://valums.com/ajax-upload/

    Hope this helpful

    Regards

    Young Yang

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, August 26, 2011 2:59 AM