Question: How to save/copy Facebook image URL to my SERVER as an image?

Question

How to save/copy Facebook image URL to my SERVER as an image?

Answers 1
Added at 2016-12-27 21:12
Tags
Question

This is the url: https://scontent.xx.fbcdn.net/v/t34.0-12/15749870_10153984148031541_865898377_n.jpg?_nc_ad=z-m&oh=73dc146bd7d8922a41c262ecc2299bb4&oe=58659947

I want to save Facebook images to my server. I tried many options such as copy, file_get_contents etc. What happens is that i get a blank image file that has 0 file size.

How do i save/copy facebook image url to my server as an image?

Answers
nr: #1 dodano: 2016-12-27 23:12

Try:

$url = "https://scontent.xx.fbcdn.net/v/t34.0-12/15749870_10153984148031541_865898377_n.jpg?_nc_ad=z-m&oh=73dc146bd7d8922a41c262ecc2299bb4&oe=58659947";

$img = './your_image_name.jpg';
file_put_contents($img, file_get_contents($url));
Source Show
◀ Wstecz