0

This is my code,

$event_info['name'] = $name2;
$event_info['category'] = 1;
$event_info['privacy_type'] = 'OPEN';
$event_info['subcategory'] = 1;
$event_info['description'] = $description_new; //description for event
//$event_info['host'] = $desc; //description for event
//$event_info['host'] = 'You';
$event_info['location'] = $location;
$event_info['city'] = $city; //Must be a valid city name

$event_info['start_time'] = $newTime; //Converts time to UTC
$event_info['picture'] = "@http://static.eventful.com/images/small/I0-001/003/184/085-4.jpeg";

Everything is post except image , I want create event with event image.

How to do it?

1 Answer 1

1

Something along these lines is what your looking for:

$fname="/tmp/foo.jpg";
$attachment =  array(
        'access_token' => $facebook->getAccessToken(),
        'name' => '',
        'description' => '',
        'start_time' => '',
        'link' => '',
        'source'=> '@'.$fname
        /*...*/
);

/*Send the data*/
$result = $facebook->api('/me/events', 'POST', $attachment);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.