Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3439452
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T08:18:43+00:00 2026-05-18T08:18:43+00:00

Possible Duplicate: Add picture at facebook event with Graph API I have been trying

  • 0

Possible Duplicate:
Add picture at facebook event with Graph API

I have been trying for a good few hours now to create an event through the Facebook API with an image. So far I have been able to create events though both the Graph and Rest APIs without images, but have been unable to attach any images.

I believe the REST API is the only API which supports attaching images, but the documentation is pretty poor and the php-sdk docs or code do not help much either.

My latest attempt is over at: http://promos.uk.glam.com/splash_test/example.php

With the code: http://pastebin.com/8JC8RAck (note the “require facebook.php” is the php-sdk – http://github.com/facebook/php-sdk/)

Note line 93 ( “if ($uid) {” ), this is supposed to be “if ($me) {“, which was working for an hour or so, and then stopped working (no changes to the code that populates $me), odd.

So, the event creation code is lines 96-99 and as it is now it creates an event without an image, but as soon as I put back in the commented out code (line 98, ) it fails to do anything.

Does anyone know how to create events on facebook though the API with images? If so, please help me out here! I have no problems scrapping all this code if there is another solution, although I have to use PHP or Javascript.

Thanks all

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T08:18:44+00:00Added an answer on May 18, 2026 at 8:18 am

    Thanks everyone for your answers, I decided to revisit this to see if the API is working correctly now. It is! Uploading pictures with the Graph API now works. Thanks to Stan James for bringing my attention to this and giving code to post photos, which I adapted for events:

    Setup:

    //Setup the Facebook object allowing file upload
    $facebook = new Facebook(array(
      'appId'  => 'xxxxxxxxxxxxxxxxxxxx',
      'secret' => 'xxxxxxxxxxxxxxxxxxxx',
      'cookie' => true,
      'fileUpload' => true
    ));
    

    Post:

    //Path to photo (only tested with relative path to same directory)
    $file = "end300.jpg";
    //The event information array (timestamps are "Facebook time"...)
    $event_info = array(
        "privacy_type" => "SECRET",
        "name" => "Event Title",
        "host" => "Me",
        "start_time" => 1290790800,
        "end_time" => 1290799800,
        "location" => "London",
        "description" => "Event Description"
    );
    //The key part - The path to the file with the CURL syntax
    $event_info[basename($file)] = '@' . realpath($file);
    //Make the call and get back the event ID
    $result = $facebook->api('me/events','post',$event_info);
    

    I have put all the code on pastebin (http://pastebin.com/iV0JL2mL), it’s a bit messy from my debugging and getting angry with Facebook months ago! But it works.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know its probably possible, but is it practical and doable to try and
I know its probably possible, but is it practical and doable to try and
I have several USB mass storage flash drives connected to a Ubuntu Linux computer
I am trying to load a html page through UIWebview.I need to disable all
I'm trying to write test harness for part of my Android mapping application. I
I'm trying to build a Chrome browser extension, that should enhance the way the
My question is about memory use and objects in actionscript 2. If I have
I am writing a query to fetch results for all the values in a
This is beyond both making sense and my control. That being said here is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.