title: Error:OAuthException: (#324) Requires upload file
body: <p>HTML form for uploading the image</p>
  
  <pre><code>&lt;form enctype="multipart/form-data" action="upload.php" method="POST"&gt;
     Please choose a photo:
     &lt;input name="photo" type="file"&gt;&lt;br/&gt;&lt;br/&gt;
     Say something about this photo:
     &lt;input name="message" type="text" value=""&gt;&lt;br/&gt;&lt;br/&gt;
     &lt;input type="submit" value="Upload"/&gt;&lt;br/&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>HTML form will be redirecting to upload.php </p>
  
  <p>Code for upload.php file ..</p>
  
  <pre><code>&lt;?php 
  //upload.php
  if(isset($_FILES['photo']) &amp;&amp; isset($_POST['message'])){
  
      $uploadfile ='./uploads/'.basename($_FILES['photo']['name']);
  
  
      $iStats=getimagesize($_FILES['photo']['tmp_name']);
  
  
      if (isset($iStats['mime']) &amp;&amp; $iStats[0]&gt;0) {
  
      move_uploaded_file($_FILES['photo']['tmp_name'], $uploadfile);
      require_once('sdk/src/facebook.php');
      require_once('utils.php');
      require_once('AppInfo.php');
      try{
  
          //this one is used to find the APPID and secret of the app
  
          $facebook = new Facebook(array(
                      'appId'  =&gt; AppInfo::appID(),
                      'secret' =&gt; AppInfo::appSecret(),
                      'sharedSession' =&gt; true,
                      'trustForwarded' =&gt; true,
                      ));
  
          $album_details = array(
                  'message'=&gt; 'Album desc',
                  'name'=&gt; 'Album name'
                  );
  
  
  
          $uid = $facebook-&gt;getUser();  //used to get the user id
  
          $me = $facebook-&gt;api('/me');
  
      $token = $facebook-&gt;getAccessToken(); //here I get the token from the $session array
  
          $create_album = $facebook-&gt;api('/me/albums', 'post', $album_details);
  
              $album_id = $create_album['id'];
  
          $facebook-&gt;setFileUploadSupport(true);
          $args['image'] = '@' . realpath($uploadfile);
  
       $data = $facebook-&gt;api('/'. $album_id . '/photos?access_token='. $token, 'post', $args['image']);
  
         //     $data = $facebook-&gt;api('/'.$album_id.'/photos', 'post', $args['image']);
  
      } catch(FacebookApiException $e){
          echo "Error:" .$e;
      }
      unlink($uploadfile);
      echo "Success!\n";
      } else {
      echo "Wrong file type!\n";
      }
  }
  
  ?&gt;
  </code></pre>
  
  <p>I am getting following error</p>
  
  <blockquote>
    <p>Error:OAuthException: (#324) Requires upload file</p>
  </blockquote>