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

Hi monks !
Let's assume you're using Firefox to surf some site , and you find something you would like to download , so you press
download and you get that dialog that asks you where would you like to save the file .
I would like to know how could you automate that part from within a script (using LWP or Mechanize)?
Thanks
  • Comment on How can I download a file sent by the server ?

Replies are listed 'Best First'.
Re: How can I download a file sent by the server ?
by blue_cowdawg (Monsignor) on May 21, 2007 at 18:24 UTC
        I would like to know how could you automate that part from within a script (using LWP or Mechanize)?

    What have you tried and had fail? If I remember correctly there are examples of how to do that in the {cpan://LWP::UserAgent] documents. Also if you do a Super Search there exist several examples that have been posted here in PM, including one to batch download the entire set of JPEG files that were published by Sports Illustrated for their swimsuit edition.


    Peter L. Berghold -- Unix Professional
    Peter -at- Berghold -dot- Net; AOL IM redcowdawg Yahoo IM: blue_cowdawg
Re: How can I download a file sent by the server ?
by wjw (Priest) on May 22, 2007 at 03:56 UTC
    In the Tools->Options Main tab you can set FireFox to "always download to (wherever you choose). Then de-select the "always ask" check box. Works for me. Hope that is helpful.
    • ...the majority is always wrong, and always the last to know about it...
    • The Spice must flow...
    • ..by my will, and by will alone.. I set my mind in motion