Page 1 of 1

uploading images with spaces & special characters

Posted: Sat May 21, 2022 3:59 pm
by andrewvideouk
Hi

I have problems with files names when someone uploads a image with spaces or something other special characters.

When the site try display image is not found. but if you copy the full path in the url bar is there. I am using CMSMS Smart Image Toolkit.

The question is its posbile to rename the file as been uploaded?

This an example of a file is not working

https://www.site.org.uk/uploads/images/blog/Grey, Paint, World Art Day Instagram Story (2).png.

I don't have any control over people what they upload files even I tell they need to rename files first.

Cheers

Andrew

Re: uploading images with spaces & special characters

Posted: Sat May 21, 2022 7:10 pm
by Dr.CSS
Have you tried using |replace:'':'' ..?

Re: uploading images with spaces & special characters

Posted: Sat May 21, 2022 10:47 pm
by andrewvideouk
How and where would you use that? The files needs to renamed as been uploaded at the backend.

Re: uploading images with spaces & special characters

Posted: Mon May 23, 2022 2:26 pm
by DIGI3
|replace can be applied to the variable you give SmartImage. It's not ideal but can help a bit. There's currently no function for renaming files on upload. It's possible you could create a UDT for that and attach it to the onFileUploaded event, but that would come with some problems as they'd likely still be selecting the poorly named file.

I did notice that SmartImage has an issue with spaces in file names that CGSmartImage didn't. I'll probably file a BR on that after doing a bit more testing.