Problem putting large files

Topics: blog
Dec 10, 2009 at 9:23 AM

I tried to upload a large file (2k) using a PUT-Request.

The server respond with '400 BadRequest: Too large request line'.

I found out that HttpParsers request limit is set to 4196.

My questions are:

- Why is the limit set to 4196 ?

- Did you see a possibility to upload large files via PUT ?

 

thanks in advance.

Coordinator
Dec 15, 2009 at 6:45 AM

Send the contents in the body if possible.

 

Don't remember why I set that limit. But the request line shouldn't be used to put large information. The parser isn't built for that.

Dec 16, 2009 at 10:56 AM

Hi,

thank you for your answer.

For me it is very important to know wether i could upload gifs via PUT-Request or not.

You wrote: 'Send the contents in the body if possible.'

An example of an PUT-Request i sent is:

 

PUT /img/test.gif HTTP/1.1
Host: 127.0.0.1:1234
Connection: Keep-Alive
Content-Type: image/gif
Content-Length: 2048


4749463837612A0....

For my understanding the gif is in the body.

I want understand you right, could you please give me an answer to clarify this ?

Thank you in advance.

Coordinator
Dec 16, 2009 at 4:03 PM

Yes. You are sending it as a body. Then it's a bug in the parser.

"Too large request line" should only be sent if "PUT /img/test.gif HTTP/1.1" are larger than 4196 bytes.