curl-users
Re: Using -F
Date: Fri, 06 Oct 2000 11:57:49 +0200
Daniel Stenberg wrote:
> > I have problems using the -F option.
> > I tried the following:
> > curl --proxy proxy:8080 --proxy-user name:passwd -F
> > "userfile=@testpic.jpg" http://www.server.tld/upload.php3
> >
> > The .jpg is 28711 Bytes, but when it arives at the server it has 28746
> > Bytes and can't be displayed by a browser anymore.
> > When I look at the picture on the server with an editor, I can see the
> > following in the first line:
> > "ntent-Transfer-Encoding: binary"
>
> This is a clear indication that you're using a faulty receiving end.
Well, I don't think so.
upload.php3 looks like this:
<?
copy($userfile,"webcam.jpg");
echo("Picture received\n
<br>
userfile-size:".$userfile_size."
");
?>
(There aren't much possibilitys to make mistakes ;-)
I tried it with Netscape and the following html-form:
<html>
<form enctype="multipart/form-data"
action="http://longlife.medical-tribune.de/webcam/index.php3"
method="post">
<input type="file" name="userfile" size="20">
<br>
<input type="submit" value="send">
</form>
</html>
The output of upload.php3 was:
Picture received
userfile-size: 28711
The picture was ok and the browser displayed it properly.
With the above curl-command, the output was:
Picture received
userfile-size: 28746
and the picture was broken :-(
Maybe the commandline options I used aren't right to simulate the above
html-form?
Greetings
Sven Rudolph
Received on 2000-10-06