dose Posted July 13, 2010 Share Posted July 13, 2010 So ive tried this a few times and gave up, and im attempting to do it again but running into the same problems =/ I wanna be able to download and save an image like this. http://www.socom.com/en-us/Clan/Badge?name=the+potheads (You will need to verify age before you can view) My problem is when you goto the link it goes to another url. This is the last thing i tried, but i just get a blank image. $url = "http://www.socom.com/en-us/Clan/Badge?name=the+potheads"; $ch = curl_init(); $fh = fopen("whatever.png", "wb"); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_FILE, $fh); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_TIMEOUT, 10); $response = curl_exec($ch); curl_close($ch); fclose($fh); Quote Link to comment https://forums.phpfreaks.com/topic/207601-need-help-saving-remote-image/ Share on other sites More sharing options...
dose Posted July 13, 2010 Author Share Posted July 13, 2010 anyone?? this has been buggin me for a while i think i gave up on tryin to do it like 7 or 8 times now :-\ Quote Link to comment https://forums.phpfreaks.com/topic/207601-need-help-saving-remote-image/#findComment-1085352 Share on other sites More sharing options...
dose Posted July 13, 2010 Author Share Posted July 13, 2010 im a bonehead lol.. i forgot to add the cookie to my curl =/ Quote Link to comment https://forums.phpfreaks.com/topic/207601-need-help-saving-remote-image/#findComment-1085362 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.