Skip to content

Instantly share code, notes, and snippets.

@niraj-shah
Created March 12, 2014 20:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save niraj-shah/9515270 to your computer and use it in GitHub Desktop.
Save niraj-shah/9515270 to your computer and use it in GitHub Desktop.
Script to upload a photo by URL (i.e. remote resource). Use code with https://gist.github.com/niraj-shah/9514525
<?php
// upload a photo to facebook by URL, will return id of uploaded photo
$photo_uploaded = $facebook->api( $page_id . "/photos", "POST", array(
'url' => 'http://healthhub.co/wp-content/uploads/2014/02/Group-Slider.jpg', // remote URL to image
'no_story' => true // suppress automatic image upload story, optional
) );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment