file upload
am 06.01.2007 22:44:23 von r.j.dobson
hi,
i'm trying to upload a couple of files using the following form:
i'm using the following piece of code to submit:
#!/usr/bin/perl
use strict;
use LWP::UserAgent;
use WWW::Mechanize;
use HTML::Form;
my $ua = LWP::UserAgent->new;
my $response = $ua->get("http://fraser.qimr.edu.au/general/daleN/ssSNPer/") ;
my $form = HTML::Form->parse($response->decoded_content,
$response->base);
my @inputs = $form->inputs;
$inputs[0]->file( "/tmp/hapmap/rs1800630snp.txt " );
$inputs[1]->file( "/tmp/hapmap/rs1800630dumpedregion.txt" );
$ua = LWP::UserAgent->new;
$response = $ua->request($form->click);
my $content=$response->content;
print $content;
the error that I get in the $content states that the files failed to upload.
Any ideas?
Re: file upload
am 07.01.2007 14:33:47 von r.j.dobson
Quoting Richard Dobson :
whoops, had I read the docs better I would have seen http::request::common
cheers
Rich
>
> hi,
>
>
> i'm trying to upload a couple of files using the following form:
>
>
>
>
>
>
> i'm using the following piece of code to submit:
>
> #!/usr/bin/perl
>
> use strict;
> use LWP::UserAgent;
> use WWW::Mechanize;
> use HTML::Form;
>
> my $ua = LWP::UserAgent->new;
> my $response = $ua->get("http://fraser.qimr.edu.au/general/daleN/ssSNPer/") ;
> my $form = HTML::Form->parse($response->decoded_content,
> $response->base);
> my @inputs = $form->inputs;
>
> $inputs[0]->file( "/tmp/hapmap/rs1800630snp.txt " );
> $inputs[1]->file( "/tmp/hapmap/rs1800630dumpedregion.txt" );
>
> $ua = LWP::UserAgent->new;
> $response = $ua->request($form->click);
>
>
> my $content=$response->content;
>
> print $content;
>
>
>
> the error that I get in the $content states that the files failed to upload.
>
>
>
> Any ideas?
>
>