Skip to content

How to cURL image-type projected image? [closed]

I have this problem.

There is a Joomla site that has a image presented via PHP file image.php that has some Content-Type to be projected as Image.

I want to get that image with cURL or file_get_contents and save it as .jpg file.

The URL Looks like:

It has image.php script that is projecting the passed image via GET parameter as Content-Type Image.

I’ve already tried standard file_get_contents() method aswell as all cURL methods described in this topic: Saving image from PHP URL

Looking for answers.



try to use file_put_contents() function

//Get the file
$content = file_get_contents("");
//Store in the filesystem.
$fp = fopen("/location/to/save/image.png", "w");
fwrite($fp, $content);

from PHP – Copy image to my server direct from URL

8 People found this is helpful