title: Facebook - How to Upload Photo Via URL?
body: <p>For example i have WordPress installed on my website. i want to upload Pictures on Facebook via URL's. MY image Url is:</p>
  
  <p><a href="http://example.com/wp-content/abc123.jpg" rel="nofollow">http://example.com/wp-content/abc123.jpg</a></p>
  
  <p>Now, i want to upload this image on Facebook via my own website directly into an specific album. I am totally N00b! So don't know anything about coding..</p>
  
  <p>My Aim is to create a cover website.</p>
  
  <p>*<strong><em>SECOND UPDATE</strong> *</em>:
  Here is the code i am using right now:</p>
  
  <pre><code>  &lt;?php
        $app_id = "12354";
        $app_secret = "1213243434";
        $post_login_url = "http://example.com/sdsds";
        $album_id = "1234224";
        $photo_url = "http://example.coom/test.jpg";
        $photo_caption = "my caption";
  
    $code = $_REQUEST["code"];
  
    //Obtain the access_token with publish_stream permission 
    if (!$code){ 
      $dialog_url= "http://www.facebook.com/dialog/oauth?"
        . "client_id=" .  $app_id
        . "&amp;redirect_uri=" . urlencode( $post_login_url)
        .  "&amp;scope=publish_stream";
      echo("&lt;script&gt;top.location.href='" . $dialog_url
        . "'&lt;/script&gt;");
    } else {
      $token_url="https://graph.facebook.com/oauth/access_token?"
        . "client_id=" . $app_id
        . "&amp;client_secret=" . $app_secret
        . "&amp;redirect_uri=" . urlencode( $post_login_url)
        . "&amp;code=" . $code;
      $response = file_get_contents($token_url);
      $params = null;
      parse_str($response, $params);
      $access_token = $params['access_token'];
  
      // POST to Graph API endpoint to upload photos
      $graph_url= "https://graph.facebook.com/" 
        . $album_id . "/photos?"
        . "url=" . urlencode($photo_url)
        . "&amp;message=" . urlencode($photo_caption)
        . "&amp;method=POST"
        . "&amp;access_token=" .$access_token;
  
      echo '&lt;html&gt;&lt;body&gt;';
         echo file_get_contents($graph_url);
  
      echo '&lt;/body&gt;&lt;/html&gt;';
    }
  ?&gt;
  </code></pre>
  
  <p>So From this code i am able to upload "test.jpg" to facebook but now the problem is I don't want to upload only one image, i want to upload lot of images so i don't want to change "$photo_url = "http://example.coom/test.jpg";" this code for new photos any help would be appreciate! </p>