Sunday, December 30, 2007

Content-Disposition with Adobe Air / Flex HTMLLoader

It appears that the HTMLLoader in Adobe AIR 1.0 Beta 3 has no way of handling the HTTP Content-Disposition header when set to type 'attachment'.

An example is
Content-Disposition: attachment; filename="fname.ext"

When the Air HTMLLoader encounters an HTTP response with a Content-Disposition similar to the example above, I haven't found a way to retrieve the HTTP response body. This is bad news if you want to create an Air browser that is capable of common Web Browser file-download behavior.

The correct behavior for an HTTP client which receives an HTTP response parameter of this type can be found in RFC 2616, section 19.5.1. It is stated that "If this header is used in a response with the application/octet-stream content-type, the implied suggestion is that the user agent should not display the response, but directly enter a ‘save response as...’ dialog". I suspect that Adobe hasn't had a chance to implement a way for HTMLLoader to notify client code of this situation, or the process for getting the HTTP response body.

I've posted to the Adobe Air forum and filed a Flex bug:
Adobe Air Forum Post
Jira Issue


nvihinen said...

This issue doesn't seem to be resolved in Adobe Air 1.0.

nvihinen said...

Updated Air 1.0 Forum Post