Aaargh! Silly me. I had forgotten to set $config['base_url']
in the CodeIgniter config.php file so elFinder was looking in a directory in a completely different application!
elFinder 2.0 Can't select image files whose names include spaces
-
29-03-2022 - |
Question
I have installed elFinder 2.0 rc1 with elRTE in a Codeigniter ver 2.1 environment. elRTE is working and I'm editing and saving files where I choose. However, I have one issue with elFinder when dealing with image files whose names contain spaces. I've checked my .htaccess
RewriteCond
settings and Codeigniter knows not to redirect when dealing with the relevant images files (e.g. with extension .jpg
), but elFinder throws a 404 error if the image file name contains spaces. I can see a thumbnail of the file in the file manager window, but when I double-click to select (or click the select button), the image does not appear in the preview window and a 404 error appears in the console. As soon as I remove the spaces, it works as normal.
I tried changing the acceptedName
option in the options I pass to the elFinder
class which in turn is passed to the elFinderConnector
class. The default acceptedName
regex is '/^\w[\w\s\.\%\-\(\)\[\]]*$/u'
. Regular expressions are my biggest nightmare, so I thought perhaps \s
was to match spaces, so I stumbled around trying to change acceptedName but it had no effect.
How can I configure elFinder to allow me to select images with names that contain spaces?
Solution