Webmasters Stack Exchange is a question and answer site for pro webmasters. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How Facebook downloads images, when you click "Download" near the picture? I see, that they are passing some argument:

_n.jpg?dl=1

,but how it is managed 'behind the scenes'?

share|improve this question

When the dl GET variable is set, Facebook's servers add the Content-Disposition: attachment header.

See RFC 2616 for details on the Content-Disposition header.

share|improve this answer
    
so when I request facebook.com/XXX_n.jpg, it is not picture, but site with extension .jpg? Or it can be done some other way? – therealszaka Aug 31 '11 at 7:14
    
@Maciekp In each case your browser is being provided with the same JPG image - the Content-Disposition header simply tells your web browser to download it instead of display it inline. – Jacob Hume Aug 31 '11 at 17:43

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.