cURL
Haxx ad
libcurl

curl's project page on SourceForge.net

Sponsors:
Haxx

cURL > Mailing List > Monthly Index > Single Mail

curl-users Mailing List Archives

Re: Send file whith post-metod

From: Daniel Stenberg <daniel_at_haxx.se>
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

These mail archives are generated by hypermail.

donate! Page updated November 12, 2010.
web site info

File upload with ASP.NET