fix: upload.defParamCharset: utf8 by default (#8157)
## Description Fixes https://github.com/payloadcms/payload/issues/8107 This has been confusing for people from countries where characters aren't latin, for example the Japanese file name: フェニックス.png Turns into: ãã§ããã¯ã¹.png Additionally, ensures type-safety for `DEFAULT_OPTIONS` and removes unused `fileHandler` property from there, which isn't defined in the `FetchAPIFileUploadOptions` type. ## Type of change <!-- Please delete options that are not relevant. --> - [x] Bug fix (non-breaking change which fixes an issue) ## Checklist: - [ ] I have added tests that prove my fix is effective or that my feature works - [x] Existing test suite passes locally with my changes - [ ] I have made corresponding changes to the documentation
This commit is contained in:
@@ -7,11 +7,11 @@ import { isEligibleRequest } from './isEligibleRequest.js'
|
||||
import { processMultipart } from './processMultipart.js'
|
||||
import { debugLog } from './utilities.js'
|
||||
|
||||
const DEFAULT_OPTIONS = {
|
||||
const DEFAULT_OPTIONS: FetchAPIFileUploadOptions = {
|
||||
abortOnLimit: false,
|
||||
createParentPath: false,
|
||||
debug: false,
|
||||
fileHandler: false,
|
||||
defParamCharset: 'utf8',
|
||||
limitHandler: false,
|
||||
parseNested: false,
|
||||
preserveExtension: false,
|
||||
|
||||
Reference in New Issue
Block a user