URL encoding filenames with Netlify Forms

Hi,

I’m using Netlify Forms to handle file uploads (such as PDFs) in my Gatsby app. After file submission Netlify provides me a Cloudfront link to preview the file. I ran into some issues with files that have URL encode breaking characters in the filename. For example if a user uploads a file ‘MyDoc#1.pdf’, the (#) sign doesn’t get URL encoded and it breaks my Cloudfront link. So is there a way to fully url encode uploaded filenames for the cloudfront link?

Thanks!

Hey @apltola,
Thanks for reporting this! The file should be there- can you please try replacing special characters in the link yourself, i.e. MyDoc%231.pdf in the Cloudfront link?

Hi Jen, thanks for the reply.

Yes, the file is there and I’m able to preview it if I fix the encoding on the cloudfront url myself. But is there a way to get Netlify forms to do the url encoding to save the manual work?

I just filed an issue based on this report- we’ll report back if/when we ship an update

1 Like

4 posts were split to a new topic: Having # in directory name results in 404

Hey @apltola,
This fix has shipped! Let us know if your links still aren’t working.

Hi Jen,
Everything seems to be working after the fix! This is now resolved, thanks!

1 Like