Jeff Herbeck <[EMAIL PROTECTED]> wrote:

: Hello,
: 
: I want to be able to have a user login with apache
: authentication (which I have that part working) and then
: take a URL from a form and download the file in that url
: and put it in a directory for that user. Here is what I
: have so far.  It runs, but it doesn't do anything but
: display "aaa"
: 
: #!/usr/bin/perl
: 
: $URL = "http://www.jeffherbeck.com/arch.doc";;
: $remote_user = $ENV{REMOTE_USER};
: use LWP::Simple;
: 
: getstore("$URL", "/var/www/html/$remote_user/");
: 
: print "Content-type: text/html\n\n";
: 
: print "aaa";

    Perhaps better written like this.

#!/usr/bin/perl

use strict;
use warnings;

use HTTP::Response;
use LWP::Simple 'getstore';

my $url         = 'http://www.jeffherbeck.com/arch.doc';
my $remote_user = $ENV{REMOTE_USER} || 'unknown_user';
my $response    = HTTP::Response->new(
        getstore(
            $url,
            "/var/www/html/$remote_user/arch.doc" ) );

print
    "Content-type: text/html\n\n",
    $response->status_line();

__END__

HTH,

Charles K. Clarkson
-- 
Mobile Homes Specialist
254 968-8328



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to