Jump to content

[SOLVED] getting images from another server on the fly...


webbnino

Recommended Posts

Hi friends,

can any one please help me on this...

 

I have a generator.php on a server(A), which gets an image from that server with an id given to the page. I have a data.php in another server(B) and I want to save the image on the server A in B by calling the generator.php in the data.php, by using some method like file_get_contents('serverA/generator.php?id-245'), This method works perfectly if we are trying to get some text information instead of an image.

Can anyone please advise on how to do this with an image , or how to send and save images using http..

 

Thanks in advance  :)

Thanks for the reply Ben.

I have to save the image to my server as well, also the path of the image in the server is generated from the id provided. In some cases cropping of the image has to be done also.

when I used,

$fil = file_get_contents('serverA/generator.php?id-245'),

file_put_contents('local-path-to-save/name.jpg',$fil);

it worked.

 

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.