file upload

hi,


i'm trying to upload a couple of files using the following form:


<p><form enctype="multipart/form-data" action="upload.cgi" method="post">
<p><b><u><font face="Arial,Helvetica"><font size=+1>
To run a detailed ssSNPer
analysis on a single SNP:</font></font></u></b>
<p><font face="Arial,Helvetica">Specify the location
of your file containing
the test SNP rs# (e.g., "<a
href="http://fraser.qimr.edu.au/general/daleN/ssSNPer/rs1800 630snp.txt">rs1800630snp.txt</a>"):</font>
<br><input name="testSNP" type="file">
<p><font face="Arial,Helvetica">Specify the location of your HapMap SNP
genotype data dump file (e.g., "<a
href="http://fraser.qimr.edu.au/general/daleN/ssSNPer/rs1800 630dumpedregion.txt">rs1800630dumpedregion.txt</a>"):</font>
<br><input name="HapMapData" type="file">
<p><font face="Arial,Helvetica">Please be patient, our web server may be
busy and depending upon the size of your test region your query may take
a few minutes (the example files take ~90 seconds).</font>
<br><input type="submit">

</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 [at] 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?
r.j.dobson [ Sa, 06 Januar 2007 22:44 ] [ ID #1587122 ]

Re: file upload

Quoting Richard Dobson <r.j.dobson [at] qmul.ac.uk>:

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:
>
>
> <p><form enctype="multipart/form-data" action="upload.cgi" method="post">
> <p><b><u><font face="Arial,Helvetica"><font size=+1>
> To run a detailed ssSNPer
> analysis on a single SNP:</font></font></u></b>
> <p><font face="Arial,Helvetica">Specify the location
> of your file containing
> the test SNP rs# (e.g., "<a
>
href="http://fraser.qimr.edu.au/general/daleN/ssSNPer/rs1800 630snp.txt">rs1800630snp.txt</a>"):</font>
> <br><input name="testSNP" type="file">
> <p><font face="Arial,Helvetica">Specify the location of your HapMap SNP
> genotype data dump file (e.g., "<a
>
href="http://fraser.qimr.edu.au/general/daleN/ssSNPer/rs1800 630dumpedregion.txt">rs1800630dumpedregion.txt</a>"):</font>
> <br><input name="HapMapData" type="file">
> <p><font face="Arial,Helvetica">Please be patient, our web server may be
> busy and depending upon the size of your test region your query may take
> a few minutes (the example files take ~90 seconds).</font>
> <br><input type="submit">
>
> </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 [at] 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?
>
>
r.j.dobson [ So, 07 Januar 2007 14:33 ] [ ID #1587817 ]
Perl » perl.libwww » file upload

Vorheriges Thema: Secure site Re-login using cookies and WWW::Mechanize
Nächstes Thema: RE: fail to redirect