0

Ok so I have a web app that needs to a large file (up to 100mb) and then do some server side conversions. I have built a model that works locally, but now that I'm trying it on my vps its taking an insanely large amount of time and not even completing. In IE it just goes to the standard error page, and in other browsers it just hangs there forever and once through a thread ending error which I've never seen.

I need to find some ways to either A) speed this process up, or B) let it be slow, but actually complete.

the model im using is simple

ASPX

<td>
<input id="videoUpload" type="file" runat="server" validationgroup="AddVideo" />
</td>

C#

if (videoUpload.PostedFile != null)
                {
                    HttpPostedFile videoFile = videoUpload.PostedFile;
                    int videoSize = videoFile.ContentLength;
                    if (videoSize > 0)
                    {
                        int lastFlvDot = videoUpload.PostedFile.FileName.LastIndexOf(".");
                        string flvExt = videoUpload.PostedFile.FileName.Substring(lastFlvDot + 1);

                        if ((flvExt == "mv4") || (flvExt == "mov") || (flvExt == "avi") || (flvExt == "mp4") || (flvExt == "wmv") || (flvExt == "mpeg"))
                        {
                            string videoPath = "video/";
                            string video = videoPath + title + "." + flvExt;
                            txtBxCaption.Text = "Started";
                            videoUpload.PostedFile.SaveAs(Server.MapPath(video));
                           
                           ...Do Some other stuff

                            File.Delete(videoLocal);

                        }

web.config

<httpRuntime executionTimeout="300" maxRequestLength="300000" requestLengthDiskThreshold="80" useFullyQualifiedRedirectUrl="false" minFreeThreads="8" minLocalRequestFreeThreads="4" appRequestQueueLimit="5000" enableKernelOutputCache="true" enableVersionHeader="true" requireRootedSaveAsPath="true" enable="true" shutdownTimeout="90" delayNotificationTimeout="5" waitChangeNotification="0" maxWaitChangeNotification="0" enableHeaderChecking="true" sendCacheControlHeader="true" apartmentThreading="false"/>

Please help. I really need this app to at least be stable by tomorrow.

3
Contributors
3
Replies
4
Views
7 Years
Discussion Span
Last Post by __avd
0

Good luck with that, I don't think ASP.NET handles large files very well :(

It is my understanding that the webserver digests the entire upload in memory before handing it over to the page processing the file so you're looking at 100mb of memory allocation before your page even loads. Your debug IIS server is more forgiving than a production IIS server so something might be killing the worker process. Check your windows event log for more information.

0

Ya I read that IIS first has to upload the entire file before it can do anything and that's a big issue, but I know there has to be a way to make the process at least stable. I am realizing there is no quick recipe to make it lightening fast, I just need it to work.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.