payloadcms / payload

The best way to build a modern backend + admin UI. No black magic, all TypeScript, and fully open-source, Payload is both an app framework and a headless CMS.
https://payloadcms.com
MIT License
21.1k stars 1.27k forks source link

Uploads with "%" in filename fail to show (s3Adapter) #6985

Open carstenblt opened 4 days ago

carstenblt commented 4 days ago

Link to reproduction

No response

Describe the Bug

When uploading a file like "test%test.jpg", it can't be viewed, because the URL is not encoded.

This could be solved by using encodeURIComponent on the filename.

To Reproduce

Payload Version

2.22.2

Adapters and Plugins

payload-cloud-storage, s3Adapter

rafalnawojczyk commented 2 days ago

I've came across the same issue in my codebase. Already created a PR that resolved this problem on my end.