in reply to Creating a short image uploader
print "\nWe found $cnt images"; # don't "use" the module in the foreach loop otherwise it's done each +time use WWW::Mechanize if $cnt > 0; unless ($cnt > 0) { print "No images selected\n"; exit 1; } my $mech = WWW::Mechanize->new(); foreach my $image (@images) $cnt2++; print "\n\t Trying picture $currentdir/$image - $cnt2 of $cnt\n"; $mech->get( $url ); # do you have the correct form here? print $mech->content; $mech->submit_form( form_number => 1, # sure? this could be one problem fields => { file => "$currentdir/$image", category => "$category", name => "$name", description => "$description" } );
|
|---|