I'm using the Image:Magick Read() to grab images off a remote server.

$image = Image::Magick->new; $url = "$Variable1/$Variable2/Filename.jpg"; $image->Read($url);

When I do this to an image within a publicly visible folder, everything works wonderfully: I am able to use Get() to assign the attributes of that remote image to variables.

However, when I try to do this to an image within a folder that is within a protected area requiring htpasswd authentication (such as a Member's Area), the Read($url) fails.

What I am looking for is a means to provide my own username and password to authenticate my script to access these protected files remotely

I have been scouring the internet to find a solution to this. Unfortunately, I am not sure exactly what approach or solution I need to be searching for. Is there a separate package that allows me to authenticate as a user, or something that allows Image::Magick to define user/pass access, or something entirely different altogether.

Any help on this matter would be GREATLY appreciated!

Thanks in advance, perlmonks community.


In reply to Trying to allow cgi script to access htpasswd protected files. by Aquilae

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.