You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As far as I can read from the WWW::Mechanize documentation (http://search.cpan.org/~jesse/WWW-Mechanize-1.70/lib/WWW/Mechanize.pm#%24mech-%3Esubmit_form%28_..._%29), you can do the following to submit a file from a string:
{{{
$mech->submit_form(
fields => {
'UploadedFile' => [[ undef, 'test2.txt', Content => $content ], 1],
}
);
}}}
This should submit a file with name text2.txt, containing the text in $content (in this case, 'The file is a lie.').
The request failed with an internal server error, however, so I examined the request that was sent, and found this:
{{{
--xYzZY
Content-Disposition: form-data; name="UploadedFile"; filename="ARRAY(0x9567570)"
The file is a lie.
--xYzZY
}}}
That is clearly not the filename I specified, so it would seem that either the documentation is wrong, or the module is bugged here.
The same thing happens if I use with_fields instead of fields.
This is using WWW::Mechanize 1.70 from CPAN on Linux.
Eckankar reported on Oct 3, 2011
Details
Imported from Google Code issue 218 via archive
The text was updated successfully, but these errors were encountered: