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

  • SEARCH
  • Home
  • 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 8253305
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T00:50:09+00:00 2026-06-08T00:50:09+00:00

I finally got facebooks graph api to post messages on my fan PAGE as

  • 0

I finally got facebooks graph api to post messages on my fan PAGE as page
How do i get it to post large images as a post, not as a link?

'source' => $photo seems to create a thumbnail

this is what i have so far

<?php

$page_id = 'YOUR-PAGE-ID';
$message = "I'm a Page!";
$photo = "http://www.urlToMyImage.com/pic.jpg";

require '../src/facebook.php';

// Create our Application instance (replace this with your appId and secret).
$facebook = new Facebook(array(
    'appId'  => 'YOUR-APP-ID',
    'secret' => 'YOUR-SECRET-ID',
));


$user = $facebook->getUser();

if ($user) {
    try {
        $page_info = $facebook->api("/$page_id/?fields=access_token");
        if( !empty($page_info['access_token']) ) {
                $facebook->setFileUploadSupport(true); // very important
                $args = array(
                        'access_token'  => $page_info['access_token'],
                        'message'       => $message,
                        'source'        => $photo

                );
                $post_id = $facebook->api("/$page_id/feed","post",$args);
        }
    } catch (FacebookApiException $e) {
        error_log($e);
        $user = null;
    }
}

// Login or logout url will be needed depending on current user state.
if ($user) {
    $logoutUrl = $facebook->getLogoutUrl(array( 'next' => 'http://mydomain.com/logout_page.php' ));
} else {
    $loginUrl = $facebook->getLoginUrl(array('scope'=>'manage_pages,publish_stream'));
}
?>
  • 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-06-08T00:50:10+00:00Added an answer on June 8, 2026 at 12:50 am

    The problem here is that you are in actual fact not posting a photo. What you are doing is posting a link to that photo so what you see is indeed a thumbnail preview image that Facebook retrieved from that URL.

    What you’ll want to do is provide a full path to a file on your server prefixed with the @ symbol. The topic has been discussed on the site quite a bit so I’ll just point you in the direction of a canonical post dealing with uploading of images to Facebook with the PHP SDK

    Upload Photo To Album with Facebook's Graph API

    The code looks like this –

    $facebook->setFileUploadSupport(true);
    $params = array('message' => 'Photo Message');
    $params['image'] = '@' . realpath($FILE_PATH);
    $data = $facebook->api('/me/photos', 'post', $params);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to use graph API to get page and app insights without
I finally got my permalinks working for Custom Post Types and Taxonomies using `
I finally got maps api implemented into jquery accordion, mainly by changing var map;
I finally got my app to be able to send text messages (SMS), but
I've finally got the first page of my registration page working. The user has
I had an app that I finally got finalized and am ready to post
I finally got my application to seemingly post to https. However, every time that
Finally got my cascading dropdownlist working only to find it's not repopulating in edit
After significant voodoo, I have finally got the scores API working. Turns out you
Finally got my first iPhone app ready for launch. There's a large publisher backing

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.