zVirx Posted November 25, 2008 Share Posted November 25, 2008 Hi, i'am still learning php and i was wondering if its possible to download a certain image from a an external website to the server's local hard disk .. for example you can get a the source of the website with cURL then fopen() a text file fwrite() the source .. and its on the server's local hard disk i wanna do the same thing but with images not text files. Thanks Link to comment https://forums.phpfreaks.com/topic/134160-solved-download-images/ Share on other sites More sharing options...
The Little Guy Posted November 25, 2008 Share Posted November 25, 2008 http://phpsnips.com/snippet.php?id=61 Link to comment https://forums.phpfreaks.com/topic/134160-solved-download-images/#findComment-698424 Share on other sites More sharing options...
bogeyman Posted November 25, 2008 Share Posted November 25, 2008 Yes it's possible. The concept is open the image file using fopen(), read it using fread(), then write it to file with fwrite(). If you are on internal network and using a proxy server to connect to the internet, you have to use fsockopen() function. Link to comment https://forums.phpfreaks.com/topic/134160-solved-download-images/#findComment-698445 Share on other sites More sharing options...
zVirx Posted November 25, 2008 Author Share Posted November 25, 2008 Thanks alot guys ^^ Link to comment https://forums.phpfreaks.com/topic/134160-solved-download-images/#findComment-698552 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.