Last post Dec 21, 2014 05:39 PM by Keep it Simple
Dec 09, 2014 01:52 AM|Keep it Simple|LINK
Using ASP.NET Web Forms, for now I want to upload a single large file with real time progress.
The real requirement once I jump this hurdle is to upload many large files associated with many upload controls in a FormView Insert or Update event. But for now I am eliminating FormView and am just using one upload control.
I have spent many days on this and have worked on various options.
Option 1: Original ASP.NET File Upload Control
The ASP.NET File Upload control renders a HTML input tag with type=”file” etc.
Given the current HTML5 “standard”; have there been any enhancements to provide real time progress updates from the original ASP.NET File Upload Control natively?
Option 2: AJAX Control Toolkit (ACT)
The end user has to explicitly click Upload for each UI control . Whereas from ASP.NET FormView Insert or Update events, I do it in code behind programmatically for many different upload controls. So, not an option as far as I can see. Furthermore, I do
not really want a dependency on ACT.
Option 3: HTML5 File Input using XMLHtTTPRequest Asynchronously to an ASHX Handler
This I can get working in terms of upload, real time progress, saving, and client response.
However, the ASHX code is separate from an ASPX code behind. So I don’t know how I would get C# code working between ASPX code behind, and ASHX during a FormView Insert.
Option 4: HTML5 File Input using XMLHtTTPRequest Asynchronously to an ASPX Page
I can only get this partly working i.e. uploading with real time progress, and file save on server.
In this option, my code resembles sample code provided in this forum post. Except, I am using asynch i.e. I have
xhr.open("POST", uploadServerSideScriptPath, TRUE);
Thanks for your help…
Dec 17, 2014 12:23 AM|gtscdsi|LINK
Please check if you can use this
Dec 17, 2014 06:47 PM|Keep it Simple|LINK
Thanks for your reply.
I had a good look at the link suggested and it is very similar to an old Microsoft code sample I found prior to the this post.
I find the following downsides to the suggested approach:
Dec 21, 2014 05:39 PM|Keep it Simple|LINK
In case it helps anyone else.
Option 1 - I cannot see any extra functionality in the standard ASP.NET file upload control to provide real time progress "out of the box"
Option 2 - I did not pursue further
Option 3 - ASPX code behind and ASHX code are separate
not in your JS.