Emmanuel Caradec
Emmanuel Caradec

Reputation: 2287

Why does posting image on a Facebook graph event is not working anymore?

I've an issue uploading image while creating a facebook graph event for a page. This code was in production and was working correctly until it stopped working on the 27th of March at 2PM.

I installed the latest facebook api. The test sample I had done didn't work anymore either.

I've look at the developer roadmap, but didn't found anything.

The error I got is :

Fatal error: Uncaught OAuthException: (#324) Missing or invalid image file thrown in C:\devel\www\create_fb_events\php-sdk\src\base_facebook.php on line 1106

My code is :

$facebook = new Facebook(array(
  'access_token' => $accessToken,
  'appId'  => $appId,
  'secret' => $secret,
  'fileUpload' => true
));
$e = $facebook->api('/'.$appId.'/events', "post", array('file.png' => '@' . realpath('C:\devel\www\create_fb_events\Elephant-icon.png').";type=image/png", 'name'=>'test9', 'description'=>'', 'start_time'=>time(), 'end_time'=>time()+5000, 'location'=>'some_place', 'privacy_type'=>'SECRET'));

Does someone has a clue ?

Upvotes: 1

Views: 2683

Answers (2)

Parris
Parris

Reputation: 18408

I just posted the following on a similar bug report: https://developers.facebook.com/bugs/443491802360253

The error is not "incorrect" it is just not that specific, and it has a poor user experience. I think there are multiple ways for an image to be invalid; however, the only one we actually encountered so far was a min image width requirement of 180px.

If you are having an issue with an image perhaps uploading the image directly into facebook would help you get more information about why the image was rejected. I think facebook itself (as opposed to the apis) provides better error messages.

Upvotes: 0

Chet Seidel
Chet Seidel

Reputation: 76

I am not encountering this error but I am using the same or similiar techniques. It appears that you are not alone, though:

Upvotes: 1

Related Questions