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 8049261
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T06:44:29+00:00 2026-06-05T06:44:29+00:00

I use this script here for my Facebook App. It uploads a photo on

  • 0

I use this script here for my Facebook App.
It uploads a photo on a user’s Facebook profile, and creates a new album for that photo.

The script returns “[APP NAME] Photos” as the Album name / title (without quotations).
– [APP NAME] being the name of my Facebook APP –

Basically, I don’t want that Album title. I want to specify an Album title on the script.
What I want is :

  • … to be able to specify the Album’s name / title to create, from the script.
  • And if possible, specify Album description too.

This is the script –

    $root_url = "http://www.WEBSITE.COM/";
    $facebook = new Facebook($config);
    $user_id = $facebook->getUser();

      // Get image from URL
      $img = $_GET['i'];
      // Change location depending on which type of cover
      if($get_set != 1) {
      $photo = './PATH/'.$img.''; // Path to the photo on the local filesystem
      } else {
      $photo = './PATH/'.$img.'';
      }
      $message = 'THIS IS THE PHOTO CAPTION';




        if($user_id) {

          // We have a user ID, so probably a logged in user.
          // If not, we'll get an exception, which we handle below.
          try {

            // Upload to a user's profile. The photo will be in the
            // first album in the profile. You can also upload to
            // a specific album by using /ALBUM_ID as the path 
            $ret_obj = $facebook->api('/me/photos', 'POST', array(
                                             'source' => '@' . $photo,
                                             'message' => $message,
                                             )
                                          );
          //  echo '<pre>Photo ID: ' . $ret_obj['id'] . '</pre>';
          print "<script>window.location = '".$root_url."index.php?cover=uploaded'</script>";

          } catch(FacebookApiException $e) {
            // If the user is logged out, you can have a 
            // user ID even though the access token is invalid.
            // In this case, we'll get an exception, so we'll
            // just ask the user to login again here.
            $login_url = $facebook->getLoginUrl( array(
                           'scope' => 'photo_upload'
                           )); 
            echo '<script> window.location = "' . $login_url . '"; </script>';
            error_log($e->getType());
            error_log($e->getMessage());
          }   

          echo '<br /><a href="' . $facebook->getLogoutUrl() . '">logout</a>';
        } else {

          // No user, print a link for the user to login
          // To upload a photo to a user's wall, we need photo_upload  permission
          // We'll use the current URL as the redirect_uri, so we don't
          // need to specify it here.
          $login_url = $facebook->getLoginUrl( array( 'scope' => 'photo_upload') );
            echo '<script> window.location = "' . $login_url . '"; </script>';
            //echo 'Please <a href="' . $login_url . '">login</a> to continue.';

        }

Seeing this one here, I am confident that is possible.

   $album_name = 'YOUR_ALBUM_NAME';
   $album_description = 'YOUR_ALBUM_DESCRIPTION';

I just don’t know how to work it in there…
Looking forward to solutions. Thanks for your time!

  • 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-05T06:44:32+00:00Added an answer on June 5, 2026 at 6:44 am

    As it says in the documentation of the Photo object:

    you can upload a photo by issuing an HTTP POST request with the photo
    content and an optional description to one these to Graph API
    connections:

    • https://graph.facebook.com/USER_ID/photos – The photo will be published to an album created for your app. We automatically create an
      album for your app if it does not already exist. All photos uploaded
      this way will then be added to this same album.

    • https://graph.facebook.com/ALBUM_ID/photos – The photo will be published to a specific, existing photo album, represented by the
      ALBUM_ID. Regular albums have a size limit of 200 photos. Default
      application albums have a size limit of 1000 photos.

    You are currently using the first option, using the 2nd one requires for you to have an album id, which you first need to create:

    You can create an album for a user by issuing an HTTP POST request to
    PROFILE_ID/albums with the publish_stream permissions and the
    following parameters
    (Albums connection of the User object)

    The problem is that you’ll have to save this album id for the user to use in the future when the app needs to upload again to the album.

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

Sidebar

Related Questions

I'm trying to use this little script I found here , but for some
When converting a MongoCursor to PHP I use this script. Which was presented here
I use this script to equalize heights of elements: (function ($) { $.fn.autoheight =
I use this script to call a javascript from codebehind. ClientScript.RegisterStartupScript(this.GetType(), Exist, <script language='javascript'>ConfirmRedirect('
I use this script to show an additional language menu additional, which works great
I use this script: $(document).ready(function() { $page = jQuery.url.attr(file); alert(page); }); but I get
I used to use this script for jquery email obfuscation: $(.replaceAt).replaceWith(@); $(.obfuscate).each(function () {
I could use another pair of eyes. This script does what I want in
During development, I use this to load the latest jQuery: <script src=http://www.google.com/jsapi></script> <script type=text/javascript>
I use Codeigniter platform to make a website I used this .load script to

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.