I had a look at several stackoverflow posts about this error message, but none of them worked for me.
I want to upload a photo to facebook:
public function uploadPhoto($path){
$photoSettings = array(
'access_token'=> $this->facebook->getAccessToken(),
'name' => 'uploaded foto',
'source' => '@' . realpath($path)
);
$photo = $this->facebook->api('me/photos','POST',$photoSettings);
}
When i call this function, i get the following error message:
Uncaught CurlException: 26: failed creating formpost data
I am 100% sure that the image i want to upload exists (and the path is correct).
This is my facebook initialization: (fileUpload is true)
$this->facebook = new Facebook(array(
'appId' => $this->config['appId'],
'secret' => $this->config['appSecret'],
'fileUpload' => true,
'cookie' => true
));
I really don't understand why i get that error because my code seems to be correct. Do you think there could be a problem with my server / the server's cURL configuration? I dont know much about cURL.
I hope you can help me! I am looking forward for your answers :-)
Greetings, Andreas