I have client who is uploading files with lots of naming issues; Spaces, dots, parenthesis, and other characters in the filenames.

Is it possible to strip out the special characters, automatically, upon upload?

Thank you in advance.

1 Answer 1


Your best bet would be to make an extension that hits this hook:


And renames the file after upload. I would check the File helper to see if it can rename files:


If not you'll have to do it in pure PHP:


Be warned; after rename the file, you'll need to use the database class to update all Assets rows that have the file name of your original file, and update them with the new file name. Also probably the EE files table.

Actually, at this point, you could honestly just hack the Assets core. I highly do not recommend doing that, but it would work for now. just regex out anything that isn't alpah-numeric.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.