Search code examples
http-headerscontent-disposition

HTTP header Content-Disposition "attachement" (rather than "attachment")


I'm writing code to read an HTTP response, and I'm seeing

 Content-Disposition: attachement; filename=xxxx

It looks like rfc2183 is the relevant standard, and it says "attachment". Searching around, I can't find anything about why a server might be returning "attachement" instead. (Part of the problem seems to be that lots of people seem to be using "attachement" as the correct spelling of the word.)

I did find a few pages (example) suggesting that IE doesn't (or didn't at one point) handle "attachment" correctly -- is this a case where everyone started writing around a bug and that's now become the standard?

If that is the case, should I consider attachment/attachement to be meaningless, and treat anything with a filename as downloadable? Or should I explicitly handle either word?

Also, in this particular case, the server belongs to my organization, and they are trying to keep everything standards-based -- can I legitimately file a bug report for this?


Solution

  • The relevant specification is RFC 6266 (http://greenbytes.de/tech/webdav/rfc6266.html), and it says that unknown disposition types should be treated as "attachment" (see http://greenbytes.de/tech/webdav/rfc6266.html#rfc.section.4.2).

    With respect to the example you cite: no, IE does support "attachment" (and has forever). The problem over there might have had to do with nonsense caching response headers.