cURL / Mailing Lists / curl-users / Single Mail


HTTP upload from stdin

From: Daniel Stenberg <>
Date: Thu, 31 May 2001 12:53:13 +0200 (MET DST)

Hi fellows.

There's an open bug report that correctly states that "http upload" doesn't
work when reading a file from stdin (you'll find the bug report here:

This is because the size of the input file is unknown and thus no
Content-Length get set when doing a HTTP PUT request. This is a violation of
RFC2616 (section 4.3).

Solution? I can only see two ways to solve this issue:

1 - curl loads everything passed to it from stdin first, then it passes it to
   libcurl and performs the upload as it then knows the size of the uploaded
   file. This will then of course use a considerable amount of memory when
   uploading large files...

2 - curl writes an error message saying that "http upload" from stdin doesn't

Any thoughts, suggestions or comments?

     Daniel Stenberg -- curl dude --
Received on 2001-05-31