in reply to Re^3: LWP::Useragent - File Upload
in thread LWP::Useragent - File Upload

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.