You can’t download the photo from the URL, it’s not even considered a “download”, since you don’t actually upload the pic, just enter the URL.
What you need to do is get the actual image data and send it directly to facebook via a POST request to this URL:
https:
with parameters: message and source.
If you do not have the image locally on the server, you need to upload it, read its “content” and then send it to facebook.
Edit
Thanks to the comment by @TommyBs, I see that it is available for download via url. I will leave the answer as it talks about the alternative.
2nd Edit
If you want to upload multiple images, you have 2 options (as I see):
(1) Use the Batch Requests provided by facebook. You will have to check if it works with this particular method, I have no idea, since I have never tried uploading the image to facebook using the URL.
(2) Send an image request, something like:
function uploadPicture($albumId, $photoUrl, $message, $token) { $url= "https://graph.facebook.com/" . $albumId . "/photos?" . "url=" . urlencode($photoUrl) . "&message=" . urlencode($message) . "&method=POST" . "&access_token=" . $token; return file_get_contents($url); }
Then just reuse this function with various parameters.
source share