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'?

link|improve this question
feedback

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.

link|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? – Maciekp 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
feedback

Your Answer

 
or
required, but never shown

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