Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Limit the number of files that can be loaded and the file type to only allow images in FileUpload
How to limit the number of files that can be loaded and the file type to only allow images using FileUpload?
I want to use File Upload to upload a picture for each discussion and show the pictures in the Discussions Board.
Wich one is the best way to do that?
Tagged:
0
Answers
We don't currently have a way to limit the number of files, but you can limit the file extensions with the following config:
which file we need to do this modification?
Config.php
Vanilla Wiki, Tastes Great! 31,000 viewers can't be wrong. || Plugin Development Explained
Hi
After a dig on finding where i can set up the allowed file extensions on fileupload plugin, i´ve realised that the file where we have to set is /conf/config-defaults.php
Around line 81
$Configuration['Garden']['Upload']['AllowedFileExtensions'] = array('txt','jpg','jpeg','gif','png','bmp','tiff','zip','gz','tar.gz','tgz','psd','ai','fla','swf','pdf','doc','xls','ppt','docx','xlsx','log','rar','7z');
@wilsoncortez: no, never edit the
config-defaults.php
, instead edit the/conf/config.php
as also specified in the readme file in that folder.Oops, sorry. I´ve read it now. But HalfCat this line mentioned by Todd isn´t on that file. Do I need to insert it in order to get control of extensions?
Second sorry if someone got my misleading comments :-(
Thank You HalfCat and if some MOD wants to delete my original post in order to get things right, please go on
@HalfCat forget to ask one
Does the the "/conf/config.php" override the config-defaults.php?
Thanks
Yes. If it isn't there, just add it.
@HalfCat Thank you HalfCat