I find it kind of interesting that you get around the thing I didn't see in HTML::Form by going and getting the form and then searching it for the right thing and filling it out blindly. I hadn't thought of doing that; it would be good errorchecking - make sure you can get to the site before submitting.
For reference, here is some code I wrote when I was still trying to use libwww-perl (it didn't work, can you tell me why? (serious query)):
#!/usr/bin/perl use HTTP::Request::Common; use LWP::UserAgent; use CGI qw(header -no_debug); my $URL = 'https://www.mydomain.com/upload.html'; my $req = POST $URL, Content_Type => 'form-data', Content => [ user => 'username', pass => 'password', FILE => ['./binaryfile'], # this file will be uploaded ]; my $res = LWP::UserAgent->new->request($req); print header, $res->is_success ? $res->content : $res->status_line;
Yes, yes, Carp, strict, -w and all that. Consider it read, for conciseness' sake. Maybe I'll try it again using HTML::Form.
In reply to RE: (jcwren) RE: amelinda's problem (I am a hardheaded SOB)
by amelinda
in thread amelinda's HTTP/MIME/file upload/not-a-cgi-but-a-client/minimal-module/perl problem
by amelinda
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |