Get file list over http

Discussion in 'Perl Misc' started by Rohit, Sep 2, 2007.

  1. Rohit

    Rohit Guest

    Hi, I am trying to write a script, which downloads files over http. I
    am using curl command to download the file, but using curl I have to
    pass filename. Filename on server would be changing frequently, so is
    there any way to get list of files over http? Once I get filename,
    then I can pass that filename to curl and download the file.

    I would also be thankful, if you can suggest any other way to achieve
    this task.

    If I have posted this message in wrong group, please rout me to
    correct group.

    I would appreciate your reply. Thanks in advance.

    Thanks,
    Rohit
     
    Rohit, Sep 2, 2007
    #1
    1. Advertising

  2. Rohit

    Rohit Guest

    On Sep 2, 3:59 pm, Christian Winter <> wrote:
    > Rohitwrote:
    > > Hi, I am trying to write a script, which downloads files over http. I
    > > am usingcurlcommand to download the file, but usingcurlI have to
    > > pass filename. Filename on server would be changing frequently, so is
    > > there any way to get list of files over http? Once I get filename,
    > > then I can pass that filename tocurland download the file.

    >
    > > I would also be thankful, if you can suggest any other way to achieve
    > > this task.

    >
    > To 'get a list of files over http' usually means to retrieve
    > the index of a directory. Depending on the configuration of
    > the server, this may be allowed/provided or not. If the browser
    > displays an explorer-like view when accessing a URL ending with
    > a directory name, it serves back a html page with a list of
    > links to each file.
    >
    > To retrieve this index page, you can use the LWP::Simple module.
    > To extract links from the page, HTML::LinkExtor or HTML::TreeBuilder
    > can aid you. If you have successfully extracted the links (all
    > modules come with a number of examples) you can once again
    > use LWP::Simple and retrieve the files directly to disk with its
    > getstore() method.
    >
    > HTH
    > -Chris
    >
    > --
    > print +(chr(-32+ord)^("Only Waiting for Perl 6" =~
    > /./g)[$c++])for('%;?- V/& !+5 V* l 8$1\'ed'=~/./g);


    Thanks Chris, It works great.
     
    Rohit, Sep 4, 2007
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Nagesh
    Replies:
    2
    Views:
    9,452
    =?ISO-8859-1?Q?Arne_Vajh=F8j?=
    Aug 12, 2006
  2. Håkan
    Replies:
    6
    Views:
    4,263
    Wade A. Hilmo [MS]
    Oct 19, 2006
  3. serge calderara

    HTTP GET vs HTTP POST protocol

    serge calderara, Nov 4, 2005, in forum: ASP .Net Web Services
    Replies:
    1
    Views:
    622
  4. n3d!m

    Http post and http get

    n3d!m, Jan 25, 2012, in forum: Python
    Replies:
    2
    Views:
    370
    n3d!m
    Feb 6, 2012
  5. Fred
    Replies:
    17
    Views:
    266
Loading...

Share This Page