سؤال

I am using the filemanager for images, now we need another one for documents, but we need to restrict to only doc, docx, xls, xlsx, pdf and some image types.

I have changed the default regex rule, to make the new validation:

$this->options['inline_file_types'] = '/(\.|\/)(gif|jpe?g|png|pdf|doc|docx|xls|xlsx|PDF|JPG|DOC|DOCX)/';

$this->options['accept_file_types'] = '/(\.|\/)(gif|jpe?g|png|pdf|doc|docx|xls|xlsx|PDF|JPG|DOC|DOCX)/';

But this new rule always gives me Filetype not allowed on a .doc, xls and xlsx file.

Can someone explain me the regex code to limit to this file extensions or tell me why this one is failing?

لا يوجد حل صحيح

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top