curl-users
Re: Send file whith post-metod
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]
-- / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2009-02-02