Support filename* parameter for Content-Disposition header of file upload

Created on 20 April 2022, about 2 years ago
Updated 21 July 2023, 11 months ago

Problem/Motivation

I would like to upload files with UTF-8 characters in the filename using jsonapi. I expected to be able to do this by using a filename*=UTF-8'' parameter in the Content-Disposition header, but found that it's not supported yet.

Steps to reproduce

Upload a file for an entity field using jsonapi with filename* in the Content-Disposition header. Example headers:

{
          'Accept': 'application/vnd.api+json',
          'Content-Type': 'application/octet-stream',
          'Content-Disposition': 'file; filename="example.txt"; filename*=UTF-8\'\'ex%C3%A4mple.txt'
}

The filename* parameter is ignored and the file will be named example.txt instead of exΓ€mple.txt. Removing the filename parameter throws an error because it is required.

Proposed resolution

Support and give preference to the filename* parameter as described at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Dispos...

✨ Feature request
Status

Active

Version

11.0 πŸ”₯

Component
JSON APIΒ  β†’

Last updated 1 day ago

Created by

πŸ‡ΊπŸ‡ΈUnited States cantrellnm

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024