PHP Classes

Upload Photos in Facebook with CallApi (problems)

Recommend this page to a friend!

      PHP OAuth Library  >  All threads  >  Upload Photos in Facebook with...  >  (Un) Subscribe thread alerts  
Subject:Upload Photos in Facebook with...
Summary:System returns error (#324) Requires upload file
Messages:2
Author:Silvio Alexandre Porto
Date:2013-11-18 00:51:47
Update:2013-12-04 09:35:07
 

  1. Upload Photos in Facebook with...   Reply   Report abuse  
Picture of Silvio Alexandre Porto 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

  2. Re: Upload Photos in Facebook with...   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2013-12-04 09:35:07 - In reply to message 1 from Silvio Alexandre Porto
That is not the way to specify files for upload. I cannot try it myself right now due to the lack of time until next week.

Can you please take a look at the Twitter example and see if you can adapt it to make it work with Facebook? Just let me know if you are not able to make it work.