cURL / Mailing Lists / curl-users / Single Mail

curl-users

RE: HTTP upload from stdin

From: Rich Gray <Rich.Gray_at_PlusTechnologies.com>
Date: Thu, 31 May 2001 09:50:34 -0400

Seems like the options are:

1. chunked transfer
2. copy to temp file, get length, send temp file in one swell foop. (yech!)

> -----Original Message-----
> From: Daniel Stenberg [mailto:daniel_at_haxx.se]
> Sent: Thursday, May 31, 2001 6:53 AM
> To: Curl Mailinglist
> Subject: HTTP upload from stdin
>
>
> 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=42673
> 9&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