SamDOD Posted March 16, 2007 Share Posted March 16, 2007 is there a way, and how, to have php take an image from a website, rename it and save it to your own server? Thank you for your time... Link to comment https://forums.phpfreaks.com/topic/43064-php-and-saving-imgs/ Share on other sites More sharing options...
fert Posted March 16, 2007 Share Posted March 16, 2007 http://us3.php.net/manual/en/function.file-get-contents.php http://us3.php.net/manual/en/function.file-put-contents.php Link to comment https://forums.phpfreaks.com/topic/43064-php-and-saving-imgs/#findComment-209184 Share on other sites More sharing options...
SamDOD Posted March 17, 2007 Author Share Posted March 17, 2007 would you happen to have an example of using these elements in this way? Link to comment https://forums.phpfreaks.com/topic/43064-php-and-saving-imgs/#findComment-209292 Share on other sites More sharing options...
fert Posted March 17, 2007 Share Posted March 17, 2007 file_put_contents("image.png",file_get_contents("http://site.com/picture.png")) this will work if you have allow_url_fopen is enabled Link to comment https://forums.phpfreaks.com/topic/43064-php-and-saving-imgs/#findComment-209300 Share on other sites More sharing options...
SamDOD Posted March 17, 2007 Author Share Posted March 17, 2007 what about libcurl extension, is that better than allow_url_fopen... Link to comment https://forums.phpfreaks.com/topic/43064-php-and-saving-imgs/#findComment-209399 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.