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
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
Comment