in reply to Trying to allow cgi script to access htpasswd protected files.
- Untested -use LWP::UserAgent; use Image::Magick; my $url = 'path/to/remotefile'; my $localfile = 'path/to/localfile'; my $ua = LWP::UserAgent->new; my $req = HTTP::Request->new; $req->authorization_basic('username', 'pass'); $ua->get( $url, :content_file => $localfile ); # do some checking here my $image = Image::Magick->new; $image->Read($localfile);
|
|---|