Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

asp.net file upload, getting timeouts on large file uploads II6 6.0

Posted on 2009-06-28
5
Medium Priority
?
808 Views
Last Modified: 2012-05-07
I have set maxrequestentity, modified the metabase.xml and turned off asp buffering and still getting a timeout at just over a minute...have no idea why!


IIS 6.0
Windows 2k3
web.config is as follows:
 
 
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.web>
<httpRuntime executionTimeout="360000" maxRequestLength="2097151" useFullyQualifiedRedirectUrl="false" 
minFreeThreads="8" minLocalRequestFreeThreads="4" appRequestQueueLimit="10000" />
</system.web>
</configuration>

Open in new window

0
Comment
Question by:bluedragon99
  • 5
5 Comments
 
LVL 1

Author Comment

by:bluedragon99
ID: 24731959
The request was aborted: The request was canceled.

WebException was unhandled, just over a minute everytime when trying to upload large files via .net code.
 Dim WebClient As New Net.WebClient
        Call WebClient.UploadFile("http://xxxxxx:xxx/xxx.aspx?filename=" & "test.dat", pathtolargefile)

Open in new window

0
 
LVL 1

Author Comment

by:bluedragon99
ID: 24732132
any way to turn on tracing/debugging to catch the prob on the webserver?
0
 
LVL 1

Author Comment

by:bluedragon99
ID: 24732237
appears that WebClient is timing out, can someone help me convert my uploader to a WebRequest?  doesnt seem to be placing the file on the IIS server...

            Dim rdr As New FileStream("C:\windows\system32\calc.exe", FileMode.Open)
            Dim req As HttpWebRequest = DirectCast(WebRequest.Create("http://xxx.xxxx.com:7601/newuppoint.aspx"), HttpWebRequest)
            req.Method = "POST"
            ' you might use "POST"
            req.ContentLength = rdr.Length
            req.AllowWriteStreamBuffering = True
 
            Dim reqStream As Stream = req.GetRequestStream()
 
            Dim inData As Byte() = New Byte(rdr.Length - 1) {}
 
            ' Get data from upload file to inData 
            Dim bytesRead As Integer = rdr.Read(inData, 0, rdr.Length)
 
            ' put data into request stream
            reqStream.Write(inData, 0, rdr.Length)
 
            rdr.Close()
            req.GetResponse()
 
            ' after uploading close stream 
            reqStream.Close()

Open in new window

0
 
LVL 1

Author Comment

by:bluedragon99
ID: 24732238
Server reciever looks like..
<%@ Import Namespace="System"%>
<%@ Import Namespace="System.IO"%>
<%@ Import Namespace="System.Net"%>
<%@ Import NameSpace="System.Web"%>
 
<Script language="C#" runat=server>
 
 
 
 
void Page_Load(object sender, EventArgs e) {
   string guid = System.Guid.NewGuid().ToString("N").ToUpper();
 
   foreach(string f in Request.Files.AllKeys) {
			
       HttpPostedFile file = Request.Files[f];
        file.SaveAs("C:\\UpPoint\\ScanMe\\test.zip");
   }
}
</Script>

Open in new window

0
 
LVL 1

Accepted Solution

by:
bluedragon99 earned 0 total points
ID: 24736988
Was the fact that you can't set a timeout value on the WebClient object...used webrequest instead.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

782 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question