Silvio Alexandre Porto - 2013-11-18 00:51:47
Olá Manuel
Estou tentando postar fotos no facebook e estou com problemas quando tento fazer o upload delas através de CallApi. Agradeço qualquer ajuda no sentido de faze-lo funcionar.
As entradas estão ok ($album_id, $this->client->access_token, $filename is a valid file and $album_description). Já fiz funcionar utilizando um formulário convencional em html com esses parametros.
Result retorna: [error] => stdClass Object ( [message] => (#324) Requires upload file [type] => OAuthException [code] => 324
And $this->client->error: { ["error"]=> string(190) "it was not possible to access the API call: it was returned an unexpected response status 400 Response: {"error":{"message":"(#324) Requires upload file","type":"OAuthException","code":324}}
agradeço antecipadamente e parabéns pela biblioteca.
abraços
Silvio
$graph_url = "https://graph.facebook.com/" . $album_id . "/photos?access_token=". $this->client->access_token;
$filename = realpath('../micro20072.jpg');
$this->success = $this->client->CallAPI(
$graph_url,
'POST', array('source'=>'@' . $filename, 'message'=>$album_description),
array('FailOnAccessError'=>true, 'Files'=>array(array('Filename'=>$filename))),
$result
);
Hi Manuel
I'm trying to post photos on facebook and I'm having troubles when I try to upload them through CallApi. I appreciate any help in order to make it work.
The entries are ok ($ album_id, $ this-> client-> access_token, $ filename is a valid file and $ album_description). I've done the upload with conventional html form and works great which these parameters.
Result returns: [error] => stdClass Object ([message] => (# 324) Requires upload file [type] => OAuthException [code] => 324
And $ this-> client-> error: {["error"] => string (190) "it was not possible to access the API call: it was returned an unexpected response status 400 Response: {" error ": {" message ":" (# 324) Requires upload file "," type ":" OAuthException "," code ": 324}}
thank you in advance and congratulations per this usefull library.
hugs
Silvio