concrete5: Invalid file extension error
If you face with an error stating "Invalid file extension" when you try to upload some file to your concrete5 website, don’t worry. You can fix it by yourself.
I got such error when tried to upload a .zip archive. So here is a solution:
1. Open /concrete/config/base.php
2. Find the following line:
define('UPLOAD_FILE_EXTENSIONS_ALLOWED', '*.flv;*.jpg;*.gif;*.jpeg;*.docx;*.xla;*.png;*.swf;*.doc; *.txt;*.xls;*.csv;*.pdf;*.tiff;*.rtf;*.m4a;*.mov;*.wmv;*.mpeg; *.mpg;*.wav;*.avi;*.mp4;*.mp3;*.qt;*.ppt');
3. Append your extension there, for example, I’ve added ;*.zip :
define('UPLOAD_FILE_EXTENSIONS_ALLOWED', '*.flv;*.jpg;*.gif;*.jpeg;*.docx;*.xla;*.png;*.swf;*.doc; *.txt;*.xls;*.csv;*.pdf;*.tiff;*.rtf;*.m4a;*.mov;*.wmv; *.mpeg;*.mpg;*.wav;*.avi;*.mp4;*.mp3;*.qt;*.ppt;*.zip');
4. Save the file (reupload if you are not editing the file directly).
That’s all. Let me know if it helps anybody.
February 5th, 2009 at 11:21 am
What if I want to allow all files to be uploaded? Then what could I use?
February 5th, 2009 at 1:27 pm
IN concrete/helpers/file.php
AFTER
public function hasAllowedExtension($filename, $extensions = NULL) {
INSERT
return true;
AND IN concrete/helpers/validation/file.php
AFTER
public function filetype($file) {
INSERT
return true;
It should allow any files to be uploaded.
February 5th, 2009 at 11:17 pm
Thanks.
June 14th, 2009 at 8:03 am
thanks
saved me a lot of searching.
(i’m siting in my living room, thanking someone i never met, who gave a few minutes of his life to let available a simple piece of information for anyone wanted to search for it. I love internet. just got to help someone else)
good health to you Denis Vlasov!!!
June 14th, 2009 at 8:21 am
AS: moved to concrete/config/app.php Wednesday; February 4, 2009
June 14th, 2009 at 8:25 am
-please ignore last comment-
in your dashboard file manger, access
you can easily define file types