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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T12:05:16+00:00 2026-05-16T12:05:16+00:00

According to Facebook graph API we can request a user profile picture with this

  • 0

According to Facebook graph API we can request a user profile picture with this (example):

https://graph.facebook.com/1489686594/picture

We don’t need any Token since it’s a public information.

But the real image URL of the previous link is: http://profile.ak.fbcdn.net/hprofile-ak-snc4/hs356.snc4/41721_1489686594_527_q.jpg

If you type the first link on your browser, it will redirect you to the second link.

Is there any way to get the full URL (second link) with PHP, by only knowing the first link?

I have a function that gets the image from a URL to store it in the database, but it does work only if it get the full image URL.

Thanks

  • 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-16T12:05:17+00:00Added an answer on May 16, 2026 at 12:05 pm

    kire is right, but a better solution for your use case would be the following:

        // get the headers from the source without downloading anything
        // there will be a location header wich redirects to the actual url
        // you may want to put some error handling here in case the connection cant be established etc...
        // the second parameter gives us an assoziative array and not jut a sequential list so we can right away extract the location header
        $headers = get_headers('https://graph.facebook.com/1489686594/picture',1);
        // just a precaution, check whether the header isset...
        if(isset($headers['Location'])) {
            $url = $headers['Location']; // string
        } else {
            $url = false; // nothing there? .. weird, but okay!
        }
        // $url contains now the url of the profile picture, but be careful it might very well be only temporary! there's a reason why facebok does it this way ;)
        // the code is untested!
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

according to fb's documentation (https://developers.facebook.com/docs/reference/api/page/) i don't need a user_access_token to retrieve the notes
I am using graph api to retrieve my friend list. https://graph.facebook.com/me/friends?access_token= I noticed it
According to http://developers.facebook.com/docs/reference/plugins/like/ I change the open graph tag to <meta property=og:site_name content=abcdefg1234> from
This is a noob question. According to Facebook API documentation, the sex field in
According to the Facebook Graph API documentation , the fields param acts as a
According to Facebook Graph API documentation, it is possible to get detailed informations about
I am trying to read a user's stream using the facebook graph api. the
According to this video http://www.facebook.com/video/video.php?v=562087699610 modern browsers break same origin policy so javascript can
I'm trying to familiarize myself with Facebook's new Graph API and so far I
I have a question regarding facebook graph api. I have database of users' facebook

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.