Possible Duplicate:
Upload Progress Bar in PHP
I have been researching this with no success.
I have a php script which uploads a picture to Facebook. On the main page I want to show a button or a link or an image which starts a progress bar and runs the upload script at background.
Here is the upload.php file:
<?php
include_once 'facebook.php';
include_once 'config.php';
$facebook = new Facebook(array(
'appId' => FACEBOOK_APP_ID,
'secret' => FACEBOOK_SECRET_KEY,
'fileUpload' => true,
));
$uid = $facebook->getUser();
$me = $facebook->api('/me');
$FILE = "images/$uid.jpg";//the file is already stored
$args = array('message' => 'Check yours on: http://apps.facebook.com/dec-death');
$args['image'] = '@' . realpath($FILE);
$data = $facebook->api('/'.$uid.'/photos', 'post', $args);
echo 'Picture has been uploaded';
?>