cmohima has asked for the wisdom of the Perl Monks concerning the following question:

Hi, I am trying to automate uploading files on a website,I used WWW::Mechanize,but it did not work as the site uses a lot of javascript. I can enter data in text boxes,but fail in the part where I need to click on browse button to search for the file to upload. sample html: td valign="middle"> <input type="file" size="15" name="NEW_DOCUMENT"> <input type="hidden" value="1309949325" name="DOC_TIMESTAMP"> I am also not able to find the browse button in html,All i get is the above code. Please help me

Replies are listed 'Best First'.
Re: browse and upload file on a website
by Corion (Patriarch) on Jul 06, 2011 at 11:00 UTC

    The "browse" button is implicit with the <input type="file" element. Maybe you need to learn a bit about HTML and HTTP? Also see WWW::Mechanize on "upload", especially the ->field method.

Re: browse and upload file on a website
by tmaly (Monk) on Jul 06, 2011 at 13:10 UTC

    If the form is complex enough, you might have luck with http://sourceforge.net/projects/lhhreplay I made an adaptation of this to generate a mechanize script from the liveheaders

Re: browse and upload file on a website
by cmohima (Initiate) on Jul 20, 2011 at 11:39 UTC
    Thank you,was able to get it done with Mechanize.