cURL / Mailing Lists / curl-library / Single Mail

curl-library

libcurl passing a file to remote server

From: Simon Suchomel <suchomel_at_fi.muni.cz>
Date: Wed, 12 May 2010 11:12:26 +0200

 Dear members, could you please guide me how to pass a file to a destination server via libcurl in perl?
 
 I am unable to pass a functional file handle, I'm trying to pass the handle via setopt with CURLOPT_POSTFIELDS option. I need to pass file as CGI parameter named FILE from the point of view of the target URL.
 
 The same as on command line: curl -F 'FILE=@/home/myfile' https://someurl
 It works fine via command line, thus I need to find alternative to the -F 'FILE=@/path' parameter via libcurl, but I'am unable to find it.
 
 Thank you very much for any hint.
 
 Yours sincerely.
 
 Simon

-- 
Simon Suchomel, Faculty of Informatics MU
suchomel_at_fi.muni.cz
+420 549 49 4644
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2010-05-12