-
Notifications
You must be signed in to change notification settings - Fork 2.4k
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
UTF-8 Filenames break EditUpload component #6811
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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 |
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:
|
This maybe unique to supabase and there's a related issue here: supabase/storage#133 However, as an S3 client, should |
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! |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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
The text was updated successfully, but these errors were encountered: