Get external site image as date: image / jpeg; base64

0

Is it possible to save an image as an external site date using javascript or php? because this was the only way I got the image to appear in the browser, to inspect this is the path:

link

But when I play directly in the browser the image is black, only on the company website it is black but contains numbers, it should be canvas, I can only see those numbers when I save with the right mouse button and click "save image like: "or another way was to open the image in the sources panel and copy the image as URI date i pasted it in the browser and there was the image perfectly, in the code it gets black too.

NOTE: This image changes every 10 seconds so that my browser needs to refresh automatically and get the next image. (the name of the image is the current time H_M_S.PNG or that in question was at 08h 03m and 28s.

    
asked by anonymous 10.03.2018 / 13:44

1 answer

0

Translating StackOverflow English:

If you have allow_url_fopen set to true :

$url = 'http://example.com/image.php';
$img = '/my/folder/flower.gif';
file_put_contents($img, file_get_contents($url));

If you do not use cURL :

$ch = curl_init('http://example.com/image.php');
$fp = fopen('/my/folder/flower.gif', 'wb');
curl_setopt($ch, CURLOPT_FILE, $fp);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_exec($ch);
curl_close($ch);
fclose($fp);

Topic is here .

    
10.03.2018 / 14:02