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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T00:02:14+00:00 2026-06-12T00:02:14+00:00

I have seen this method being used on about three sites now, including Facebook,

  • 0

I have seen this method being used on about three sites now, including Facebook, Dropbox and Microsoft’s Skydrive. It works like this. Let’s say you want to look at the image without downloading, then you’d just do this.

https://fbcdn-sphotos-a.akamaihd.net/hphotos-ak-xxxx/xxx_xxxxxxxxxxxxxxx_xxxxxxxxx_o.jpg

But if I want to download it, I’d add ?dl=1

https://fbcdn-sphotos-a.akamaihd.net/hphotos-ak-xxxx/xxx_xxxxxxxxxxxxxxx_xxxxxxxxx_o.jpg?dl=1

Easy peasy right? Well, it’s probably not easy on the server side, and this is where my problem is. I would know how to do this if that .jpg-file was a PHP script and the $_GET parameter pointed to the image and another parameter would specify whether the image were to be downloaded or not. But that’s not the case.

So, what methods did I try? None. Because I honestly have no idea how this works, it’s like magic to me. Maybe it’s something that you do in .htaccess? That sounds reasonable to me, but after a while of googling I didn’t find anything even close to what I’m asking for.

  • 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-12T00:02:16+00:00Added an answer on June 12, 2026 at 12:02 am

    You have some options.

    One option would be to use a PHP script instead of the .jpg file. So your URL would point to a PHP file and in the PHP file you would do something like this:

    header('Content-Type: image/jpeg');
    
    if ($_GET['dl'] == 1)
        header('Content-Disposition: attachment; filename="downloaded.jpg"');
    
    $file = $_GET["file"];
    // do some checking to make sure the user is allowed to get the file specified.
    echo file_get_contents($file);
    

    Another option would be to use mod_rewrite in your .htaccess file to check for ?dl=1 and if found, redirect to the PHP script that will download the file (the same way as above).

    I’m sure there are more options, but those two are the only ones popping into my head right now.

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

Sidebar

Related Questions

I have a method annotated with @PrePersist annotation but I've seen that when this
I have seen this talked about but never answered. Maybe it has and I'm
I have seen this question that talks about getting the last part of a
I have seen this question about deploying to WebSphere using the WAS ant tasks.
I have seen this question and its answers and they clear up some of
I have seen this error around the web a couple times and yet i
i have seen this block of code in this Stackoverflow as a answer of
I have seen this symbol/operator in a block of code: a+=1; But I cannot
I have seen this for a long time, and finally decided to put the
I have seen this statement in many of the documention samples, like here This

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.