Re: Urgent Help needed with Post method file upload
"Eric Langheinrich" <[email protected]>
| Newsgroups | gmane.comp.lang.perl.modules.lwp |
|---|---|
| Message-ID | <009601c5a058$065c5dd0$0800a8c0@UNSPAM1> |
I reread the docs and saw this: [ $file, $filename, Header => Value... ] [ undef, $filename, Header => Value,..., Content => $content ]The first value in the array ($file) is the name of a file to open. This file will be read and its content placed in the request. The routine will croak if the file can't be opened. Use an undef as $file value if you want to specify the content directly with a Content header. The $filename is the filename to report in the request. If this value is undefined, then the basename of the $file will be used. You can specify an empty string as $filename if you want to suppress sending the filename when you provide a $file value. And updated my post request to look like this: my $response = $ua->request(POST $baseurl, Content_Type => 'form-data', Content => [ request_params => $task_add_postkey, datafile => [ undef, 'datafile', Content-Type => 'application/octet-stream', Content => $filedata ] ]); When I run the script, I get: Bareword "Content" not allowed while "strict subs" in use at regcompliance.pl line 438 Any ideas? Thank you, Eric