Http error 404 on transmitting big data

H

hhp

Hi,

I have a web service with a method like:

public string InsertData(string type, byte[] content)
{ ... }

and a client which calls the method similar to:

using (BinaryReader reader=new BinaryReader(new FileStream(name,..)))
{
byte[] data = reader.ReadBytes((int) reader.BaseStream.Length);
webSvr.InsertData("file", data);
}


It's all ok but the data of content exceeds about 4 MByte of size. Then the
client gets an 404 http error. It's the same on XP and Vista.

What could happen here? Thanks in advance for any help.
Harald Pitro
 
A

Arnout Grootveld

I have a web service with a method like:

public string InsertData(string type, byte[] content)
{ ... }

and a client which calls the method similar to:

using (BinaryReader reader=new BinaryReader(new FileStream(name,..)))
{
byte[] data = reader.ReadBytes((int) reader.BaseStream.Length);
webSvr.InsertData("file", data);
}

It's all ok but the data of content exceeds about 4 MByte of size.
Then the client gets an 404 http error. It's the same on XP and Vista.

Check out the maxRequestLength attribute of httpRunTime (Web.config). This
defaults to 4 MB.
 
J

Joy

Hi,
You will need to add this Key in your Web.config:

<maxRequestLength = "YourValue">

Where YourValue = numeric value signifying the size in KB

regards,
Joy

Arnout Grootveld said:
I have a web service with a method like:

public string InsertData(string type, byte[] content)
{ ... }

and a client which calls the method similar to:

using (BinaryReader reader=new BinaryReader(new FileStream(name,..)))
{
byte[] data = reader.ReadBytes((int) reader.BaseStream.Length);
webSvr.InsertData("file", data);
}

It's all ok but the data of content exceeds about 4 MByte of size.
Then the client gets an 404 http error. It's the same on XP and Vista.

Check out the maxRequestLength attribute of httpRunTime (Web.config). This
defaults to 4 MB.
 
H

hhp

Hi Joey, hi Arnout,

many thanks for your help! I'll give it a try.

Regards,
Harald Pitro


Joy said:
Hi,
You will need to add this Key in your Web.config:

<maxRequestLength = "YourValue">

Where YourValue = numeric value signifying the size in KB

regards,
Joy

Arnout Grootveld said:
I have a web service with a method like:

public string InsertData(string type, byte[] content)
{ ... }

and a client which calls the method similar to:

using (BinaryReader reader=new BinaryReader(new FileStream(name,..)))
{
byte[] data = reader.ReadBytes((int) reader.BaseStream.Length);
webSvr.InsertData("file", data);
}

It's all ok but the data of content exceeds about 4 MByte of size.
Then the client gets an 404 http error. It's the same on XP and Vista.

Check out the maxRequestLength attribute of httpRunTime (Web.config). This
defaults to 4 MB.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,810
Latest member
Kassie0918

Latest Threads

Top