php - Error:OAuthException: (#324) Requires upload file -


html form uploading image

<form enctype="multipart/form-data" action="upload.php" method="post">    please choose photo:    <input name="photo" type="file"><br/><br/>    photo:    <input name="message" type="text" value=""><br/><br/>    <input type="submit" value="upload"/><br/> </form> 

html form redirecting upload.php

code upload.php file ..

<?php  //upload.php if(isset($_files['photo']) && isset($_post['message'])){      $uploadfile ='./uploads/'.basename($_files['photo']['name']);       $istats=getimagesize($_files['photo']['tmp_name']);       if (isset($istats['mime']) && $istats[0]>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 1 used find appid , secret of app          $facebook = new facebook(array(                     'appid'  => appinfo::appid(),                     'secret' => appinfo::appsecret(),                     'sharedsession' => true,                     'trustforwarded' => true,                     ));          $album_details = array(                 'message'=> 'album desc',                 'name'=> 'album name'                 );            $uid = $facebook->getuser();  //used user id          $me = $facebook->api('/me');      $token = $facebook->getaccesstoken(); //here token $session array          $create_album = $facebook->api('/me/albums', 'post', $album_details);              $album_id = $create_album['id'];          $facebook->setfileuploadsupport(true);         $args['image'] = '@' . realpath($uploadfile);       $data = $facebook->api('/'. $album_id . '/photos?access_token='. $token, 'post', $args['image']);         //     $data = $facebook->api('/'.$album_id.'/photos', 'post', $args['image']);      } catch(facebookapiexception $e){         echo "error:" .$e;     }     unlink($uploadfile);     echo "success!\n";     } else {     echo "wrong file type!\n";     } }  ?> 

i getting following error

error:oauthexception: (#324) requires upload file


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -