#!perl use strict; use WWW::Mechanize; my $url = "http://www.example.com"; my $field_name = 'ctl00$ContentPlaceHolderContent$FileUpload_opfFile'; my $file_name = 'c:/test/9780547076034NIMAS.opf'; my $mech = WWW::Mechanize->new(); $mech->get($url); $mech->submit_form( form_number => 1, fields => { $field_name => $file_name }, ); die unless ($mech->success);