0

I'm developing a web (using asp.net and c#) which has a FileUpload control from asp.net. The upload thing works perfect and as far as I know I can't show progress data (%, bytes transfered, upload speed, time elapsed, time left, progress bar) using the FileUpload control from asp.net because its not asyncrhonous.

I've searched a lot (really) on the internet and I didn't find what i'm looking for and too much info has become a big confusion since I'm not sure about what I have to use.

On my web page I have a file named "UploadFile.aspx" which has a FileUpload control and a button that handles the uploading. On code-behind (UploadFile.aspx.cs) I have all the server-side logic (Upload the file into specific folder, store info about that file into a database, etc. etc) and I don't want to change this.

What I need to know is how to show the progress data to the user while is uploading the file? I can't use 3rd party applications because this is for an important commercial site. It's not a problem for me if I have to learn javascript / jQuery / Whatever but really i'm a bit lost and I don't know how to start.

Thanks for your time and your help guys.

2
  • have you really searched the internet because I did a search in google using this C# create a file upload with progress bar and have returned tons of examples.. here is link you can look at dotnetfunda.com/articles/… if you are not familiar with markup language in the .aspx code as well as the code behind in the example.. I suggest you study this code and learn from experimenting with the sample pasted in this link Commented Aug 7, 2012 at 19:37
  • Hi DJ KRAZE, thanks for your reply. Yes, I did, i've searched a lot indeed i've marked up a lot of resources but none of them with useful information, lot of plugins and 3rd party things that is not what im looking for. In the other hand, the link above does not have too much information about how the progress bar is working. I'm not saying that does not work but there are things that are not explained and because of the importance of the web that i'm developing I can't use or code something that i'm not sure how its works. Thanks for your reply and your time. Commented Aug 7, 2012 at 23:19

3 Answers 3

1

There's some pretty cool solutions out there. Granted, you can code your own, but I'd suggest using a jQuery plugin like Plupload. If you need help setting it up, you can read their documentation.

Sign up to request clarification or add additional context in comments.

1 Comment

Hi @cereallarceny! Thanks for your reply! I took a look to that plugin but as I've said before I prefer to code one upload progress by my own because of the importance of the site. However I searched a bit more on google and i've found that the best way to do some kind of upload progress at real time is using hidden iframes. I've found this link mattberseth.com/blog/2008/07/… but I can't download the source code. I'll try to do something like that.
1

There are lots of lots of demo code are available on the net to show the progress bar with file upload control in c#, most of them work fine on Local system but never work on the live server, Because You CAN'T USE A FileUpload control for what you want to do. When a user POSTs a file, you have to think of it like a querystring parameter. It goes as one Http Request. If you want to do a progress bar you'll want to look into something that can interact with the server asynchronously.

Comments

0

If you don't want to use any 3rd party that relies on Flash / Html 5, please take a look at this article:

http://vanacosmin.ro/Articles/Read/AjaxFileUpload

This is possible (and if you're using .NET 4.5 GetBufferedInputStream will make your life easier), but it is not very easy, as you'll see.

Basically, if you want a file upload with progress bar that is fully compatible with every browser, you need to handle this server side and give an url where the client (the browser) can check periodically for the progress with ajax.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.