http://www.perlmonks.org?node_id=1157512


in reply to Re^2: File upload w/WWW::Mechanize
in thread File upload w/WWW::Mechanize

Hi,

Well, jkenneth was last here (8 years ago), so I'll answer

But isn't there another solution? Why do I have to reach into the innards of $agent to specify the file path, the submitted filename and the content type?

You're not reaching into the innards of $agent, you're shaking hands as intended

Anyway, you don't have to go through HTML::Form to upload a file, you can just do it the LWP way, the docs know all, https://metacpan.org/pod/HTTP::Request::Common#POST-url, Re: PUT a Multipart request in PERL ( lwp-mechanize-put-multipart-form.pl )