Comments (2)
Hi @alexkli ! So the filename*=UTF-8''
is all valid, but the issue here is the literal spaces in the file name after that is invalid according to the RFC. This is because extended parameter values cannot contain spaces.
The following would be the correct form of the above header:
inline; filename="beijing 6 copy 4.jpeg"; filename*=UTF-8''beijing%206%20copy%204.jpeg
Notice how the space characters are encoded as %20
, as the value of filename*=
is to be a percent-encoded form. Parameters that end with a *
are considered an extended parameter and the format is defined in https://tools.ietf.org/html/rfc5987
The following is the relevant ABNF for extended parameters:
ext-parameter = parmname "*" LWSP "=" LWSP ext-value
ext-value = charset "'" [ language ] "'" value-chars
; like RFC 2231's <extended-initial-value>
; (see [RFC2231], Section 7)
charset = "UTF-8" / "ISO-8859-1" / mime-charset
value-chars = *( pct-encoded / attr-char )
pct-encoded = "%" HEXDIG HEXDIG
; see [RFC3986], Section 2.1
attr-char = ALPHA / DIGIT
/ "!" / "#" / "$" / "&" / "+" / "-" / "."
/ "^" / "_" / "`" / "|" / "~"
; token except ( "*" / "'" / "%" )
I hope this helps!
from content-disposition.
👍 thanks for the quick answer. This should help me locate the issue.
from content-disposition.
Related Issues (20)
- Allow for Non-Standard Charset Name HOT 1
- Feature request: browser support HOT 13
- BUG: "attachment; [email protected]" fails HOT 2
- Is it safe to use with aws-sdk? HOT 8
- Generate ext-parameter when utf8 and latin1 representations don't match HOT 14
- filename* is not supported HOT 2
- filename not support chinese is become `????.epub` HOT 3
- Usage in browser. path and safe-buffer modules HOT 3
- should decode the header value HOT 1
- Possibly address other control characters in header HOT 2
- Doesn't work anymore if path package is installed HOT 8
- Tests using deep-equal won't fail HOT 1
- No matching version found for [email protected]. HOT 1
- Will this package ever hit a major version? HOT 1
- ISO-8859-1 (`ByteString`) is confused with ASCII string HOT 5
- Remove use of Node.js modules HOT 3
- Allow to be built with webpack, use only some features. HOT 1
- Problems with supporting Cyrillic alphabet HOT 5
- Certain languages can't be matched correctly by the Regular Expression EXT_VALUE_REGEXP like en-US or zh_cn HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from content-disposition.