title: Having trouble posting a picture to Facebook via Graph / CURL
body: <p>There has been some discussion on this here on SO, and I've tried all suggestions I found, but no dice.</p>
  
  <p>Every time I post to FB wall using my app, everything goes well <strong>except the darn picture</strong>  attachment which does not show on the wall.</p>
  
  <p>I am using CURL as follows </p>
  
  <pre><code>$attachment =  array(
      'access_token'  =&gt; $fb_user['access_token'],
      'message'       =&gt; $fb['post_text'],
      'link'          =&gt; $fb['post_url'],
      'name'          =&gt; $fb['post_title'],
      'description'   =&gt; 'bla',
      'picture'       =&gt; rawurlencode($fb['post_picture']),
  );
  
  $ch = curl_init();
  curl_setopt($ch, CURLOPT_URL,'https://graph.facebook.com/' . $fb_user['uid'] . '/feed');
  curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
  curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
  curl_setopt($ch, CURLOPT_POST, true);
  curl_setopt($ch, CURLOPT_POSTFIELDS, $attachment);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);  //to suppress the curl output
  $result = curl_exec($ch);
  curl_close($ch);
  </code></pre>
  
  <p>I'm sure you've seen this code before. Anyway, picture doesn't show on wall.</p>
  
  <p>I've run the picture URL through the FB linter and it returns 200 <strong>but</strong> gives an error that seems oxymoronic</p>
  
  <pre><code>http://example.com/images/pictures/post/full/0367496d7569e6a85ec4d64af02f6b60.jpg
  Response Code:  200
  Errors That Must Be Fixed
  Can't Download: Could not retrieve data from URL.
  </code></pre>
  
  <p>Of course, I can bring up the image on my browser. And all folders on the path to the picture are <code>755</code>, and the picture itself is <code>644</code>.</p>
  
  <p>So if you have any ideas to throw at me please give me a pointer how to debug this. Any comments are welcome.</p>
  
  <p>Thanks.</p>
  
  <p>++++++++++++++++++++</p>
  
  <pre><code>$attachment =  array(
      'access_token'  =&gt; $fb_user['access_token'],
      'message'       =&gt; $fb['post_text'],
      'link'          =&gt; $fb['post_url'],
      'name'          =&gt; $fb['post_title'],
      'description'   =&gt; 'bla',
      'media'         =&gt; array(
                         'type' =&gt; 'image',
                         'src'  =&gt; rawurlencode($fb['post_picture']),
                         'href' =&gt; $fb['post_url'],
                         ),
  );
  </code></pre>