473,225 Members | 1,183 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,225 software developers and data experts.

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.Create(
req.Method = "POST";

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

Stream stream = req.GetRequestStream();

using (BinaryWriter writer = new BinaryWriter(stream))
{
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(buffer, 0,
buffer.Length)) 0) && !Stop)
{
writer.Write(buffer, 0, i);
total += i;
uploadWorker.ReportProgress((int)(total *
100 / fileSize));
}
}
}

SERVER side script is:

Stream inputStream = HttpContext.Current.Request.InputStream;

using (BinaryReader reader = new
BinaryReader(inputStream))
{
FileStream fs = new FileStream(fullfile,
FileMode.Create);

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

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

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

Would be grateful for help.
Kind Regards
PK
Aug 5 '08 #1
2 4340
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 maxRequestLength="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
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...
3
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...
6
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...
6
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...
17
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...
6
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...
2
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...
1
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...
17
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>...
0
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

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.