title: How can I upload photos to album using Facebook Graph API
body: <p>Here is the code:</p>
  
  <pre><code>$file= 'bbbb.jpg';
  $data = array(
              basename($file) =&gt; "@".realpath($file),
              "caption" =&gt; "Uploaded using graph api",
              "aid" =&gt; '13595',
              "access_token" =&gt; $accessToken,
              'method' =&gt; 'photos.upload'
  );
  $sds =$facebook-&gt;api($data);
  </code></pre>
  
  <p>This is the error </p>
  
  <blockquote>
    <p>Uncaught CurlException: 26: failed creating formpost data</p>
  </blockquote>
  
  <p>What to do?</p>