Question

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?

Was it helpful?

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.

OTHER TIPS

A conspiracy theorist might note that the HTML standards are based in Paris and attachement is a French spelling but as already noted the specified behaviour is to treat unrecognised strings as attachment, so it might be a typo or it might be French people not noticing that they used a French spelling because they get the expected behaviour. Possibly both.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top