uploading images with spaces & special characters

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
andrewvideouk
Forum Members
Forum Members
Posts: 155
Joined: Thu Aug 20, 2020 10:49 pm

uploading images with spaces & special characters

Post 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
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12709
Joined: Thu Mar 09, 2006 5:32 am
Location: Arizona

Re: uploading images with spaces & special characters

Post by Dr.CSS »

Have you tried using |replace:'':'' ..?
andrewvideouk
Forum Members
Forum Members
Posts: 155
Joined: Thu Aug 20, 2020 10:49 pm

Re: uploading images with spaces & special characters

Post by andrewvideouk »

How and where would you use that? The files needs to renamed as been uploaded at the backend.
User avatar
DIGI3
Dev Team Member
Dev Team Member
Posts: 1609
Joined: Wed Feb 25, 2009 4:25 am
Location: Victoria, BC

Re: uploading images with spaces & special characters

Post 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.
Not getting the answer you need? CMSMS support options
Post Reply

Return to “Modules/Add-Ons”