in reply to Trying to allow cgi script to access htpasswd protected files.

As others have suggested, you could use LWP::UserAgent. This allows you to set the authorization header via HTTP::Headers. You could then transfer the image to a local directory and feed that to Image::Magick.
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);
- Untested -
  • Comment on Re: Trying to allow cgi script to access htpasswd protected files.
  • Download Code