Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Graeme W 113 posts 289 karma points
    Nov 04, 2014 @ 18:20
    Graeme W
    0

    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

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Nov 04, 2014 @ 20:58
    Jan Skovgaard
    1

    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

  • Simon 692 posts 1068 karma points
    Dec 16, 2016 @ 11:38
    Simon
    0

    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

  • Simon 692 posts 1068 karma points
    Dec 18, 2016 @ 14:37
    Simon
    0

    Any feedback please?

    Kind Regards

  • Graeme W 113 posts 289 karma points
    Nov 05, 2014 @ 12:10
    Graeme W
    0

    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!

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Nov 05, 2014 @ 12:33
    Jan Skovgaard
    0

    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

  • Graeme W 113 posts 289 karma points
    Nov 06, 2014 @ 11:41
    Graeme W
    0

    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

    <!-- 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>
    
  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Nov 06, 2014 @ 18:33
    Jan Skovgaard
    0

    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

  • Graeme W 113 posts 289 karma points
    Nov 12, 2014 @ 12:24
    Graeme W
    0

    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?

    enter image description here

Please Sign in or register to post replies

Write your reply to:

Draft