1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Unable to download image with Curl.

Discussion in 'PHP & Perl' started by timtation, Feb 17, 2011.

  1. timtation

    timtation Registered Member

    Joined:
    Dec 15, 2010
    Messages:
    59
    Likes Received:
    0
    I have an image on a remote server that I need to download with Curl. Pretty simple stuff. The odd thing is... I can view the image in my browser, but as soon as I attempt to download the image with Curl, instead of getting image data, the server responses back with an 'Error... Unavailable.'

    I am already setting the User Agent of my Curl request to something else, so I don't think that's it.

    Does anyone have any other ideas on how they could be blocking my Curl request?
     
  2. easyroms

    easyroms Newbie

    Joined:
    Nov 5, 2009
    Messages:
    15
    Likes Received:
    1
    Whats the URL to the image? Have you tried using file_get_contents() ?
     
  3. artizhay

    artizhay BANNED BANNED

    Joined:
    Nov 21, 2010
    Messages:
    1,870
    Likes Received:
    1,335
    Or just imagejpeg(), imagepng(), etc.
     
  4. Autumn

    Autumn Elite Member

    Joined:
    Nov 18, 2010
    Messages:
    2,197
    Likes Received:
    3,045
    Occupation:
    I figure out ways to make money online and then au
    Location:
    Spamville
    Set CURLOPT_VERBOSE to 1 and then post the output here so we can see what's going on.
     
  5. jcbizzled

    jcbizzled Registered Member

    Joined:
    Aug 23, 2010
    Messages:
    50
    Likes Received:
    12
    Might want to check if the server in question is blocking it because you aren't passing their site as the referrer in the HTTP request header (maybe they try to prevent hotlinking of their images or something).