Accessing Files through http?

Discussion in 'Perl Misc' started by Ron T., Feb 26, 2007.

  1. Ron T.

    Ron T. Guest

    I would just like to ask if there's a way I could somehow read the
    contents of a text file that is posted online using Perl code? If so,
    is it also possible to open the file if it has a login verification
    before access? I know it might possibly involve the use of HTTP
    modules, but I'm not too sure how to approach the security login
    information.

    If you can help out or maybe give me some pointers on where to look to
    get started, I'd greatly appreciate it!

    Thanks,
    Ron Thompson
     
    Ron T., Feb 26, 2007
    #1
    1. Advertising

  2. Ron T.

    Paul Lalli Guest

    On Feb 26, 9:06 am, "Ron T." <> wrote:
    > I would just like to ask if there's a way I could somehow read the
    > contents of a text file that is posted online using Perl code?


    Yes.

    perl -MLWP::Simple -le'getprint("http://example.com/foo.txt");'

    > If so,
    > is it also possible to open the file if it has a login verification
    > before access?


    Yes.
    http://search.cpan.org/~gaas/libwww-perl-5.805/lwpcook.pod#ACCESS_TO_PROTECTED_DOCUMENTS


    Paul Lalli
     
    Paul Lalli, Feb 26, 2007
    #2
    1. Advertising

  3. Ron T.

    gf Guest

    On Feb 26, 7:06 am, "Ron T." <> wrote:
    > I would just like to ask if there's a way I could somehow read the
    > contents of a text file that is posted online using Perl code? If so,
    > is it also possible to open the file if it has a login verification
    > before access? I know it might possibly involve the use of HTTP
    > modules, but I'm not too sure how to approach the security login
    > information.


    Check out the LWP Perl module on CPAN, and especially read the LWP
    Cookbook.

    After that, check out WWW::Mechanize as it's built on LWP and will
    streamline a lot of what LWP does for you.

    Greg
     
    gf, Feb 26, 2007
    #3
  4. Ron T.

    Ron T. Guest

    On Feb 26, 10:12 am, "Paul Lalli" <> wrote:
    > On Feb 26, 9:06 am, "Ron T." <> wrote:
    >
    > > I would just like to ask if there's a way I could somehow read the
    > > contents of a text file that is posted online using Perl code?

    >
    > Yes.
    >
    > perl -MLWP::Simple -le'getprint("http://example.com/foo.txt");'
    >
    > > If so,
    > > is it also possible to open the file if it has a login verification
    > > before access?

    >
    > Yes.http://search.cpan.org/~gaas/libwww-perl-5.805/lwpcook.pod#ACCESS_TO_...
    >
    > Paul Lalli


    Thank you for the referrals, I really appreciate it! Seems like
    exactly what I need
     
    Ron T., Feb 26, 2007
    #4
    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. Aymer
    Replies:
    1
    Views:
    503
    Steve C. Orr [MVP, MCSD]
    Nov 9, 2003
  2. Brian Henry
    Replies:
    5
    Views:
    10,068
    Steven Cheng[MSFT]
    Aug 3, 2004
  3. RayAll
    Replies:
    7
    Views:
    2,486
    RayAll
    Mar 2, 2005
  4. R. Readi
    Replies:
    2
    Views:
    327
    Dan Pop
    Jul 23, 2004
  5. Graham Stokes

    Accessing .xml files through rubyzip

    Graham Stokes, Nov 5, 2006, in forum: Ruby
    Replies:
    2
    Views:
    109
    Chilkat Software
    Nov 5, 2006
Loading...

Share This Page