title: Upload image to Facebook Wall / Feed via Graph API
body: <p>I am trying to upload local images directly to a pages feed (i.e. "Wall Photos" album).</p>
  
  <p>This is the code that I think <em>should</em> work:</p>
  
  <pre><code>&lt;?php
  $facebook = new Facebook(array(
      'appId'  =&gt; $the_app_id,
      'secret' =&gt; $this_app_secret,
  ));
  $facebook-&gt;setAccessToken($the_access_token);
  $facebook-&gt;setFileUploadSupport(true);
  
  $attachment = array(
      'message' =&gt; $the_post_body,
      'name' =&gt; $this_image_name,
      'picture' =&gt; '@' . $the_absolute_path_to_image
  );
  
  $result = $facebook-&gt;api('/me/feed, 'post', $attachment);
  </code></pre>
  
  <p>But this code just yields a plain text wall post with the contents of "message" (i.e. picture field is seemingly ignored). I have also tried "/page_id/feed", same result.</p>
  
  <p>Now, simply changing the endpoint to "/me/photos", does upload the photo to a 'normal' album with the name of the app, but I want it to look as much like a normal post as possible and so hence into the "Wall Photos" album).</p>
  
  <p>I realise that I could achieve this by querying the graph with FQL to find the object_id of the "Wall Photos" album, but if it does not exist it would require extra permissions to create it and I would rather keep permissions as simple as possible.</p>
  
  <p><strong>If anyone could point out how to upload photos to "/me/feed" I would greatly appreciate it.</strong></p>