Not sure if you can do it without using some code to check wether a certain filetype is allowed or not. I know that you can add disallowed file types in the /config/umbracoSettings.config file in the <disallowedUploadFiles> setting.
At the moment it's not a big enough issue for me to spend a lot of time on - just some of our user base have really old versions of Office so can't open newer files if our content editors don't remember to save them as older versions before uploading.
However what was slightly more disturbing/puzzling is that content editors can upload just about anything - including exe files!
Hmm, it's been a while since I had to deal with, which file types can be uploaded in the media section but is .exe not disallowed by default in .NET unless you configure the web.config otherwise?
As I wrote above I think you need to add some code in order to restrict the upload - But perhaps it's worth opening an issue on http://issues.umbraco.org/issues about it to bring focus to the feature.
I'll probably leave it a couple of days before raising an issue, just in case someone else sees this thread and can offer some advice
For info the settings in the UmbracoSettings.config file are pasted below - the comments were already there, not mine.
Makes it look like adding file extensions here should work without having to write code
<!-- These file types will not be allowed to be uploaded via the upload control for media and content -->
<disallowedUploadFiles>ashx,aspx,ascx,config,cshtml,vbhtml,asmx,air,axd,docx</disallowedUploadFiles>
As a plan B / stopgap I was thinking of adding some guidance notes to content editors on the screen where media files are uploaded (screenshot below); however I can't workout which file to update. Can anyone point me in the right direction?
Restricting file types that can be uploaded to the back office media section
Is it possible to restrict the type of files that can be uploaded to the media section by content editors?
For example if we wanted to disallow .xlsx but allow .xls file types to be uploaded
thanks
Hi Graeme
Not sure if you can do it without using some code to check wether a certain filetype is allowed or not. I know that you can add disallowed file types in the /config/umbracoSettings.config file in the
<disallowedUploadFiles>
setting.However I'm not sure if it's enough or if you need to hook into the upload event using code as well, which Sebastiaan mentions in this rather old post here: http://our.umbraco.org/projects/website-utilities/multiple-file-upload/bugs/17159-How-do-I-restrict-the-files-that-can-be-uploaded - I suspect the concept would still be the same but you could start out by just trying to add the unwanted file types in the section mentioned above.
Remember to recycle the app pool once this is done.
Don't know if this video from 2012 by Tim Geyssens could be useful to get some inspiration as well? http://www.nibble.be/?p=202
Hope this helps.
/Jan
Hi Jan,
I am trying to upload an .exe file, changed the maxfileSize in web.config but now I am getting an error in console.
Are there a way how I can upload a .exe file in Meda Folder in Umbraco?
I am using the 7.5.2
Kind Regards
Any feedback please?
Kind Regards
Hi Jan
Thanks for the pointers. I tried amending the
At the moment it's not a big enough issue for me to spend a lot of time on - just some of our user base have really old versions of Office so can't open newer files if our content editors don't remember to save them as older versions before uploading.
However what was slightly more disturbing/puzzling is that content editors can upload just about anything - including exe files!
Hi Graeme
Hmm, it's been a while since I had to deal with, which file types can be uploaded in the media section but is .exe not disallowed by default in .NET unless you configure the web.config otherwise?
As I wrote above I think you need to add some code in order to restrict the upload - But perhaps it's worth opening an issue on http://issues.umbraco.org/issues about it to bring focus to the feature.
/Jan
Thanks Jan
I'll probably leave it a couple of days before raising an issue, just in case someone else sees this thread and can offer some advice
For info the settings in the UmbracoSettings.config file are pasted below - the comments were already there, not mine. Makes it look like adding file extensions here should work without having to write code
Hi Graeme
Yeah, I suspected that something needs to be done in code after reading Sebastiaans comments in the thread I posted above.
Hopefully someone knows how to do it :)
/Jan
As a plan B / stopgap I was thinking of adding some guidance notes to content editors on the screen where media files are uploaded (screenshot below); however I can't workout which file to update. Can anyone point me in the right direction?
is working on a reply...