473,796 Members | 2,872 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

WebRequest - large files - timeout problem.

Hi

I am trying to upload a 700 mb file using webrequest/response model.
At 3x% I am getting the same error:

"Unable to write data to the transport connection: an established
connection was aborted by the software in your host machine"

CLIENT side script is:

req = WebRequest.Crea te(
req.Method = "POST";

//Headers
req.ContentType = "multipart/form-data";
req.ContentLeng th = fileSize;
req.Headers.Add ("Name", file.Name);
req.Headers.Add ("Path", path);
req.Headers.Add ("SessionID" , session);
req.Timeout = int.MaxValue;

Stream stream = req.GetRequestS tream();

using (BinaryWriter writer = new BinaryWriter(st ream))
{
FileStream fs = new FileStream(file .FullName,
FileMode.Open);

using (BinaryReader reader = new BinaryReader(fs ))
{
int i = 0;
long total = 0;

byte[] buffer = new byte[32768];

while (((i = reader.Read(buf fer, 0,
buffer.Length)) 0) && !Stop)
{
writer.Write(bu ffer, 0, i);
total += i;
uploadWorker.Re portProgress((i nt)(total *
100 / fileSize));
}
}
}

SERVER side script is:

Stream inputStream = HttpContext.Cur rent.Request.In putStream;

using (BinaryReader reader = new
BinaryReader(in putStream))
{
FileStream fs = new FileStream(full file,
FileMode.Create );

using (BinaryWriter writer = new
BinaryWriter(fs ))
{
int i = 0;
byte[] buffer = new byte[32768];

while ((i = reader.Read(buf fer, 0,
buffer.Length)) 0)
{
writer.Write(bu ffer, 0, i);
}
}
}

Server has <httpRuntime maxRequestLengt h="102400" /in its config
file.

Would be grateful for help.
Kind Regards
PK
Aug 5 '08 #1
2 4384
Piotrekk said:
I am trying to upload a 700 mb file using webrequest/response model.
At 3x% I am getting the same error:

"Unable to write data to the transport connection: an established
connection was aborted by the software in your host machine"
Server has <httpRuntime maxRequestLengt h="102400" /in its config
file.
Increase that value. It represents the maximum data amount that can be
uploaded in kB. Your maximum therefore is 100MB which doesn't quite
cover your 700mb ;)

Cheers,
Udo
Aug 5 '08 #2
I think you should find another way to upload such a big file, IIRC
the maximum size for ASPNET is like 100MB
Aug 5 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
6166
by: shailesh kumar | last post by:
Hi, I need to design data interfaces for accessing files of very large sizes efficiently. The data will be accessed in chunks of fixed size ... My data interface should be able to do a random seek in the file, as well as sequential access block by block.... One aspect of the usage of this interface is that there is quite good chance of accessing same blocks again and again by the application..
3
2289
by: Steven Burn | last post by:
The application; Service on my webserver that allows a user to upload their HOSTS file for functions to verify the contents are still valid. Uses; 1. XMLHTTP (MSXML2) 2. FileSystemObject 3. CrazyBeavers Upload control (couldn't get the Dundas one to work)
6
6774
by: Ryan Hartman | last post by:
I am attempting to use the technique in KB 812406 (http://support.microsoft.com/?kbid=812406) to transfer large files via Response.OutputStream.Write. It works GREAT in in debug mode. But whenever I set debug="false" in the web.config file clients get cutoff after about 1.5 minutes. There is no error raised the client simple gets an incomplete file.
6
2237
by: Ramesh | last post by:
Hi, We are receiving an error 'The operation has timed out' when our ASP.NET application on Web Server stores large files 10MB+ on the App Server using HTTP PUT. This is a Server to Server communication. This works fine with 4-5 MB files though. Also there is a 15 mb shared bandwidth limitation. how can we throttle/control the transfer rate to see that we are within the bandwidth limits ? Any help is highly appreciated
17
5218
by: jensen bredal | last post by:
Hello, i'm struggling with a somehow badly understood session scenario. I provide acces to my pages based on form authentication using Session cookies. Som of my pages are supposed to be running continuously and refreshing once an hour. I there set timeout= 61 in <sessionState section and on my page it says <meta http-equiv="refresh" content="3600">. I also set timeout=120 in the <forms section of web.config to make sure
6
4329
by: Russell Stevens | last post by:
I use a WinForm app for users to upload a file to my server. Basically one line of code; Response = WC.UploadData(MyUrl, "PUT", MyByteArray) Works fine except for larger files. After about 104 seconds I get a System.Net.WebException in System.dll. The message is "The operation has timed out". On my server, I have modified the machine.config file for the httpRuntime
2
2708
by: WSE with SSL and large amount of data | last post by:
Hi there, What's the better strategy for uploading large files trough webservices? I can use Dime/WS-Attachments but for files with over 5MB in size, maybe I got some timeout/refuse problems in my server. Is it a good idea upload the files in chucks? In this case, how can I control and validate the transfering, and ensure the security? As a matter of fact, I have to use standarts for EDI processes. Thanks in advanced.
1
2339
by: Steven Berkovitz | last post by:
Hi there, I am having a problem with an ASP.NET 1.1 application running on II6. When uploading large files, the attempt seems to timeout (in the form of a IE DNS error) after about a minute even though I have adjusted the executionTimeout and maxRequestLength attributes of the httpRuntime element. <httpRuntime executionTimeout="1200" maxRequestLength="20480"
17
9956
by: byte8bits | last post by:
How does C++ safely open and read very large files? For example, say I have 1GB of physical memory and I open a 4GB file and attempt to read it like so: #include <iostream> #include <fstream> #include <string> using namespace std; int main () {
0
9679
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9527
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10172
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7546
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6785
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5441
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5573
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3730
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2924
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.