Download image to my server with php

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
sammeras
Forum Newbie
Posts: 1
Joined: Sat May 24, 2008 2:46 am

Download image to my server with php

Post by sammeras »

Hello,
I am new at php.
I am trynig to download image to my server (OR to my local computer).
The images located at: http://pms.panet.co.il/online/images/music_new/222.jpg
How can download it with php code?


Best regards,
SAM.
User avatar
Oren
DevNet Resident
Posts: 1640
Joined: Fri Apr 07, 2006 5:13 am
Location: Israel

Re: Download image to my server with php

Post by Oren »

Code: Select all

$data = file_get_contents('http://pms.panet.co.il/online/images/music_new/222.jpg');
file_put_contents('path/on/my/server/img.jpg', $data);
Post Reply