cURL / Mailing Lists / curl-users / Single Mail


Re: Send file whith post-metod

From: Daniel Stenberg <>
Date: Mon, 2 Feb 2009 12:51:29 +0100 (CET)

On Mon, 2 Feb 2009, Левченко Кирилл Сергеевич wrote:

> $file=</home/user/file1.xml>
> open (FS, "$file") or die "error open: $!";
> $upload=`curl -d <FS> $url/KbrReceive/"`;
> close FS;
> sh: FS: No such file or directory

Eh, this has nothing to do with curl but all to do with perl. If you're doing
syntactically wrong perl code, you can't expect it to work!

> $upload=`curl -d "home/user/file1.xml" $url/KbrReceive/"`;
> Don't work

This version sends the file name you mention. The curl man page tells you to
prefix the data with a '@' letter to read the data to send from the given file
name. Like:

   curl -d @home/user/file1.xml [URL]


List admin:
Received on 2009-02-02