Exoon Posted December 1, 2007 Share Posted December 1, 2007 Hello, I was wondering if it was possible to get PHP to save a load of images onto my computer. Ive got code to read the website i want the images from and i can get the URL of every image i need but i dont want to manually save them 1by1. Any Help would be great. Thanks! Link to comment https://forums.phpfreaks.com/topic/79737-using-php-to-save-an-image-on-my-computer/ Share on other sites More sharing options...
MadTechie Posted December 1, 2007 Share Posted December 1, 2007 Yes/No You can save them to the PHP server.. if thats on your computer then yes.. if its not then you could creates and archive and save that (or have a ton of save prompts for each file) easy option.. install WAMP. create a script to leach the images ie <?php $URLs[] = "http://blar.com/images.test1.jpg"; $URLs[] = "http://blar.com/images.test2.jpg"; $URLs[] = "http://blar.com/images.test3.jpg"; $URLs[] = "http://blar.com/images.test4.jpg"; $URLs[] = "http://blar.com/images.test5.jpg"; foreach($URLs as $URL) { //save Image to local $file = file_get_contents($URL); file_put_contents("SaveImageToPath/".basename($URL),$file); } ?> EDIT: updated remember this is a basic example and save all images to the same folder .. Link to comment https://forums.phpfreaks.com/topic/79737-using-php-to-save-an-image-on-my-computer/#findComment-403788 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.