16
2010
Subir archivos al facebook con php +Curl
Aquí el código como respuesta de muchas personas que me han mandado un mail para preguntarme si se puede, ahora les digo que si es posible, y sin más que decirles aquí les dejo el código fuente.
require_once 'facebook.php';
$appapikey = 'xxx';
$appsecret = 'xxx';
$facebook = new Facebook($appapikey, $appsecret);
$session_key = 'xxx'; //this is the infinite session_key returned when asking for the offline_access extended permission
$args = array(
'method' => 'facebook.video.upload',
'v' => '1.0',
'api_key' => $appapikey,
'call_id' => microtime(true),
'format' => 'JSON',
'session_key' => $session_key,
'title' => 'My video title',
'description' => 'My video description'
);
ksort($args);
$sig = '';
foreach($args as $k => $v) {
$sig .= $k . '=' . $v;
}
$sig .= $appsecret;
$args['sig'] = md5($sig);
$args["short.wmv"] = '@E:\path\to\short.wmv';
$ch = curl_init();
$url = 'http://api-video.facebook.com/restserver.php?method=facebook.video.upload';
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $args);
$data = curl_exec($ch);
print_r($data); //returned xml here
?>
Comenten para ver como les funciono.
Related Posts
1 Comment + Add Comment
Leave a comment
Patrocinador
Siguenos
Suscribete
Correo @zoneartcss.com
Comentarios
- juan manuel en Subdominios con php y .htaccess
- PCHART-Crear gráficas en PHP | Espacio de *M@?!*[lOs KeRoS mUcHo a ToDoS...] en Pchart – Crear gráficas en PHP
- EH en Evitar resize de un textarea con CSS
- KAREN en Envia mensajes de texto gratis a celulares telcel
- Elie Cottage en Ventajas y desventajas de tener un blog gratis

An article by







Hey,
I saw your code. First removes all cookies of previous session. cURL is a great library for file transmissions via different types of protocols. The library supports the transport via POST, GET, FTP upload and much more. The default value to file upload within PHP is 2MB, if you want bigger size than upload PHP configuration.
Thanks
File recovery