Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I noticed an odd behavior with this link; it doesn't open the pdf in my browser (Firefox), and it doesn't ask if I want to save the pdf file. It just downloads the pdf file without any notification. I don't recall ever seeing an invisible download like this before.


You can do this with the header:

    Content-Disposition: attachment
That's the correct way to do it. What's actually happening is that the wrong content type is being returned:

    Content-Type: application/octet-stream
This is the lazy way to do it.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: