user2064468
user2064468

Reputation:

Copy image file from source to destination in PHP

How can we copy image file from source(another server) to destination(our server) without using copy() of php.

Is there any other way possible for it?

Thanks..

Upvotes: 0

Views: 590

Answers (1)

user2533777
user2533777

Reputation:

<?php
$url="http://foo.com/foo.jpg";
$name="foo.jpg";
$img= file_get_contents($url);
file_put_contents($name,$img);
?>

Upvotes: 3

Related Questions