Skip to content

filename*=UTF-8''... #2007

@kengruven

Description

@kengruven

When letting a user download a file, you can put a "filename=" in the content-disposition field to suggest to the client what to save it as.

It looks like this field is somewhere between "not fully specified" and "not consistently implemented", especially for non-ASCII encodings.

I think RFC-6266 says that something like this should work:

filename*=UTF-8''blahblahblah

where blahblahblah is UTF-8-encoded text. (That's two adjacent single-quotes at the start, not an un matched double-quote.)

But there are also apparently lots of other RFCs to choose from, and the various browser vendors appropriately picked their favorites. I tried the above with Firefox and Safari just now, and they each did something different, and neither gave me a file called blahblahblah.

It would be great if caniuse had something for the content-disposition filename= feature!

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions