Copied to clipboard

Flag this post as spam?

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


  • Ismail Mayat 4511 posts 10092 karma points MVP 2x admin c-trib
    Jun 07, 2017 @ 15:47
    Ismail Mayat
    0

    restict image and file types in media section

    Hello,

    I remember in the older versions of umbraco you could set allowed image types in media section it used to be in umbracoSettings. In v7 how do you do this? As I do not see this anymore.

    Also for files to restrict file types how would you do this? Would you need to create your own property editor?

    Regards

    Ismail

  • Brett Fullam 119 posts 629 karma points
    Jun 07, 2017 @ 16:37
    Brett Fullam
    100

    Hi Ismail,

    I'm using v7.6.2 and I found the upload control for media and content under Config\umbracoSettings.config. I used it to add SVG. Here's what you'll need to modify to add to or restrict what can be added to the media section:

    \Config\umbracoSettings.config:
       52  
       53      <!-- These file types will not be allowed to be uploaded via the upload control for media and content -->
       54:     <disallowedUploadFiles>ashx,aspx,ascx,config,cshtml,vbhtml,asmx,air,axd,swf,xml,xhtml,html,htm,svg,php,htaccess</disallowedUploadFiles>
       55  
    

    In regards to your question about whether or not you need a custom property editor ... that's a good question. The code above restricts the file type for the WHOLE platform ... how to restrict filetypes on a case-by-case use is a question for some more experienced developers here in the forum.

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies