bpops Posted February 1, 2008 Share Posted February 1, 2008 I would like to have a form such as this: Image URL: [________________________] [_Submit_] that when clicked, takes the image from (any) url and saves a copy in a specified directory. I have found many tutorials on UPLOADING images, but I can't find information on how to grab one from a URL. Can anyone quickly point me to a function or tutorial? Thanks in advance for your help! Quote Link to comment https://forums.phpfreaks.com/topic/88933-solved-copy-images-from-another-website/ Share on other sites More sharing options...
bpops Posted February 2, 2008 Author Share Posted February 2, 2008 Well I think I finally figured out one way of doing it. It works perfectly, and it's very little code: Given the url ($url) and desired filename ($filename): $im = @imagecreatefromjpeg($url); if($im){ imagejpeg($im, $filename); } There might be a better way of doing it, but I'm happy with this. If anyone else has any comments, feel free to ad them, but I'll go ahead and mark this solved. Quote Link to comment https://forums.phpfreaks.com/topic/88933-solved-copy-images-from-another-website/#findComment-455922 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.