cURL / Mailing Lists / curl-users / Single Mail

curl-users

HTTP upload from stdin

From: Daniel Stenberg <daniel_at_haxx.se>
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:
http://sourceforge.net/tracker/index.php?func=detail&aid=426739&group_id=976&atid=100976).

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
   work.

Any thoughts, suggestions or comments?

-- 
     Daniel Stenberg -- curl dude -- http://curl.haxx.se/
Received on 2001-05-31