I’m having trouble with Facebook’s PHP SDK when trying to let page followers upload pictures. I set up a Facebook business page and want any user who follows it to be able to post custom images (they’re automatically generated collages made from multiple photos). The weird thing is that when I’m logged in as the page admin, everything works perfectly. But when regular users try to upload, they get blocked.
function uploadImageToPageAlbum($userID, $caption) {
$targetAlbum = '425X71X892341X9';
$fbClient->enableFileUploads(true);
$imagePath = "@" . realpath('uploads/generated' . $userID . '.png');
$parameters = array(
'caption' => $caption,
'access_token' => $pageToken,
'source' => $imagePath
);
$response = $fbClient->api('/' . $targetAlbum . '/photos', 'POST', $parameters);
return $response;
}
Is there some Facebook permission or page setting I’m missing? I’ve been stuck on this for days and can’t figure out why normal users can’t upload while admins can.
yeah, this broke when facebook changed their rules around 2018-2019. your php code isn’t the problem - facebook killed user-to-page posting for security reasons. only page admins can post directly now. i worked around it by creating a submission form where users upload collages to my server, then i manually approve and post them with my admin token.
Had this exact issue two years ago building a photo contest app. Your code’s fine - it’s Facebook’s policy changes screwing things up. Since 2018, they’ve locked down page posting permissions hard, even with proper tokens. Regular users can’t post to business pages they don’t own through third-party apps anymore without Facebook’s blessing. You’ll need app review and the “pages_manage_posts” permission. Expect weeks of waiting and they’re picky as hell about approving these. Way easier solution: have users post to their own timelines and tag your page instead. Works with current policies, no special permissions needed. I switched to this approach and it killed all the headaches.
Facebook’s API permissions have gotten way more restrictive over the years. Your code isn’t the problem - it’s how Facebook handles third-party posting to business pages now. You can upload because you’re an admin with the right permissions. Regular users don’t have those privileges, even through your app. Facebook requires approval for any app that lets users post to pages they don’t own. Here’s what you can do: set up a moderation queue where users submit their collages and you post them with your admin access. This keeps you in control of what gets published while still getting users involved. Or try a hashtag campaign - users share posts on their own timelines and tag your page for visibility.