UTF-8 Filenames break EditUpload component #7655
Replies: 4 comments
-
Hey @aus - I have been unable to reproduce the issue above with uploading a screenshot with the MacOS screenshot utility. Can you please send over your Uploads config, as well as, an example image file that you are having difficulties uploading? And can you confirm with me if you are still experiencing this issue on the latest beta version - I.e |
Beta Was this translation helpful? Give feedback.
-
Yes, this happens with You can reproduce the filename via: cp someimage.png $(echo U2NyZWVuc2hvdCAyMDI0LTA3LTExIGF0IDEuMDguNDXigK9QTS5wbmcK | base64 -d) Speficially, I think this is the U+202F character breaking things. s3Storage plugin settings: plugins: [
s3Storage({
collections: {
media: {
prefix: 'media',
}
},
bucket: process.env.S3_BUCKET || '',
config: {
forcePathStyle: true,
credentials: {
accessKeyId: process.env.S3_ACCESS_KEY_ID || '',
secretAccessKey: process.env.S3_SECRET_ACCESS_KEY || '',
},
region: process.env.S3_REGION,
endpoint: process.env.S3_ENDPOINT,
},
}),
], CollectionConfig: export const Media: CollectionConfig = {
slug: 'media',
admin: {
group: 'Manage',
},
access: {
read: () => true,
},
fields: [
{
name: 'alt',
type: 'text',
required: true,
},
],
upload: true,
} Here's the full stack trace:
|
Beta Was this translation helpful? Give feedback.
-
This maybe unique to supabase and there's a related issue here: supabase/storage#133 However, as an S3 client, should |
Beta Was this translation helpful? Give feedback.
-
Hey @aus - just spoke to the team about this - one way you could get around this is using a We will most likely add in our own sanitization in the Let me know if there is anything else! |
Beta Was this translation helpful? Give feedback.
-
Link to reproduction
No response
Payload Version
3.0.0-beta.47
Node Version
v20.12.2
Next.js Version
15.0.0-rc.0
Describe the Bug
When a file with a UTF-8 filename is selected for upload in the Upload component, the upload fails (at least for S3 storage providers). An ASCII string is passed to EditUpload filename prop.
A common example is the MacOS default screenshot file names. Example:
Reproduction Steps
Adapters and Plugins
No response
Beta Was this translation helpful? Give feedback.
All reactions