Storing an image from a link in PHP -


A direct link for an image is given, how can I store the actual image on a folder I created on my server Php?

Thanks

  $ image_url = 'http: // example. Com / image.jpg '; $ Image = file_get_contents ($ image_url); File_put_contents ('/ my / path / image.jpg', $ image);  

In a walnut, grab the image, store the image .. It's easy.

Note: allow_url_fopen should be set to correct for php.ini setting. Example above to work.


Comments

Popular posts from this blog

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -