Page 1 of 1

Prevent use whitespaces in files which users upload

Posted: 18 Aug 2016, 15:18
by fafnir1990
Hello, is there any simple solution for preventing using whitespaces in files which users upload?
If not, please give me any suggestions how can I block files with whitespaces in names. Which script should I modify? Maybe a trigger in database?

Best regards
Rafal

Re: Prevent use whitespaces in files which users upload

Posted: 18 Aug 2016, 23:54
by Jan
Hi, didn't test it so I cannot give any clue advice, but before upload to the server, you should e.g. str_replace(' ', '_', $file); the file.

Upload functions you will find here:
administrator/components/com_phocadownload/libraries/phocadownload/file/fileupload.php

See the variable $file

Jan

Re: Prevent use whitespaces in files which users upload

Posted: 19 Aug 2016, 11:39
by fafnir1990
Jan, thank you very much for your help!