March 2003
Intermediate to advanced
312 pages
7h 12m
English
The Content-Disposition header, which is borrowed from RFC 1806, allows for some additional flexibility with regard to media types. The most common use of this header is to force a filename for a file that should be saved rather than rendered. An example of this use is the following:
Content-Disposition: attachment; filename=”example.pdf”
This indicates that the user should be prompted to download the file and that the pre-filled filename should be example.pdf.
Note
This technique can also resolve the browser flaw mentioned previously, where the file extension is used to determine media type instead of the Content-Type entity header. Thus, Content-Disposition can allow the true filename of the resource to be overridden. ...
Read now
Unlock full access