Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

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
add comment

1 Answer

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? –  Dupadupa 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
add comment

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.