Perl-Sensitive Sunglasses | |
PerlMonks |
Re^4: LWP::Useragent - File Uploadby bliako (Monsignor) |
on Dec 20, 2018 at 22:04 UTC ( [id://1227551]=note: print w/replies, xml ) | Need Help?? |
Hi leefp, My advice was very narrow in that it concentrated on how to be effective in doing a POST and ignored the bigger picture of uploading a file to server. I simply spotted that your POST params were in the wrong format and alerted you. However, for this particular case, i.e. of uploading the contents of a file, you need to send the contents of the file as multipart/form-data. HTTP::Request can take the name of the file (via Content => [ file => [$file] ], as poj suggested) and will take care of the rest (opening the file, encoding, etc.). So, try to add a header of Content like poj said.
In Section
Seekers of Perl Wisdom
|
|