Jump to content

Copy images


-Karl-

Recommended Posts

save the images in a folder and file names in a database on the main website and then open a database connection from the second website calling the info from the first website in the database connection on the second website don't use localhost use the first websites ip address also on the first website if need be in your cpanel allow remote sql access from the ip address of the second one

Link to comment
https://forums.phpfreaks.com/topic/203483-copy-images/#findComment-1065987
Share on other sites

30 seconds, for a 700 byte file? I highly doubt that.

 

I've created a new method, however, it's not saving it correctly for some reason.

 

$id = image;
$ch = curl_init ("http://www.thatsite.com" . $id);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_BINARYTRANSFER,1);
$rawdata = curl_exec ($ch);
curl_close ($ch);

$fp = fopen("images/image.gif",'w');
fwrite($fp, $rawdata);
fclose($fp);

 

When trying to load it I get

The image “***/images/image.gif” cannot be displayed, because it contains errors.

 

That's using firefox

Link to comment
https://forums.phpfreaks.com/topic/203483-copy-images/#findComment-1066003
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.