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

I have a webserver hosting a few small programs and would like to create a script that I can run from my client and download a program from the webserver. I know I can do this via ftp but I don't want to expose the server credentials as others may use the script to grab the latest build of a program from my server.

What is the best approach? It needs to be a script because users won't or don't need to access the webserver.

Is this better suited for LWP?

Thanks

Replies are listed 'Best First'.
Re: Downloading with Perl?
by pc88mxer (Vicar) on Jun 05, 2008 at 00:46 UTC
    How about creating your own authentication system using your web server? Just put your files in some protected directory that requires authentication. Then you can add and revoke access as needed.

    Additionally, you won't have to give someone a script to download the files - they can just use their web browser. But if you need to script it, you can use LWP or wget or curl or ... In any case, the credentials you put in the script will only give access to the files in the protected directory.

      Is it possible to get the files without supplying the credentials as if I were getting them from the server via a hyperlink?
Re: Downloading with Perl?
by igelkott (Priest) on Jun 05, 2008 at 06:52 UTC
    don't want to expose the server credentials

    Consider encryption through scp or sftp. Either could be scripted rather and maintain a good level of secrecy.

Re: Downloading with Perl?
by ysth (Canon) on Jun 05, 2008 at 02:46 UTC
    I'm not sure what you mean.

    If you are running something on your client, it does have to have some way of getting the file, whether that's ftp, http, or other, so you are going to be exposing the server.

    If you are talking about a script that runs on the server and provides the program to the client, that would presumably be a script running under your webserver, but so they'd need to be able to access the webserver.

Re: Downloading with Perl?
by Anonymous Monk on Jun 05, 2008 at 12:24 UTC
    It seems as though someone has already done the work for me. The File-Fetch module does exactly what I want. Here's my next question. How would I determine the percentage of downlaod so I can update the user with it's progress?

    Thanks