in reply to File POSTing with WWW::Curl::Easy

perl CURL upload -> curl upload xml file

CURL upload site:perlmonks.org -> Correct way to POST with Perl Curl?

curl attachment site:search.cpan.org -> WWW::Curl::Form

use WWW::Curl::Form; my $curlf = WWW::Curl::Form->new; $curlf->formaddfile($filename, 'attachment', "multipart/form-data" +); $curlf->formadd("FIELDNAME", "VALUE"); $curl->setopt(CURLOPT_HTTPPOST, $curlf);

Yup, I think I'd stick with WWW::Curl::Form

Replies are listed 'Best First'.
Re^2: File POSTing with WWW::Curl::Easy
by kurt2439 (Sexton) on Jan 27, 2012 at 15:10 UTC

    You're right -- the WWW::Curl::Form made this super easy after I realized that the package created the linked list object to include as an argument to the CURLOPT_HTTPPOST in your curl handle and was NOT a separate, limited curl handle object (I know, I know, it was right there in the code example but it was so easy to overlook). It does require a newer version of WWW::Curl than ship with CentOS5 just for reference for others. Learned a bunch about the different POST options sludging through the curl.haxx.se pages too

    Thanks for the links and the help. Guess I should have done a better job searching here. I shall do penance