Upload Image from URL using PHP
Upload Image from URL using PHP
- Started
- Last post
- 3 Responses
- ********
Anyone know of how you upload an image from a supplied URL rather than from the users computer... I'm using php... cheers
- neverblink0
I've never tried if
$url = "http://www.somesite.com/image.j...
$image = imagecreatefromjpeg($url);
worked..
- acescence0
check out the cURL library. you'll probably want to do some error handling, like timeouts and bad URLs
- ********0
something like this does it...
$fn = fopen( $src_img,"w");
while(!feof($f)){
$fc.=fgets($f);
};
fwrite( $fn,$fc);