Copied to clipboard

Flag this post as spam?

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


  • Nicolai Sørensen 42 posts 66 karma points
    Mar 30, 2016 @ 11:30
    Nicolai Sørensen
    0

    Breaks Media drag and drop

    After installing Color Palettes the drag and drop in media breaks, and every upload gives this error:

    (Only allowed file types are: "!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.")
    

    Could it be your use of accept variable that angular also uses for the upload.

    Uninstalling Color Palettes fixes problem.

  • Bjarne Fyrstenborg 1257 posts 3802 karma points MVP 5x c-trib
    Mar 30, 2016 @ 17:50
    Bjarne Fyrstenborg
    0

    Hi Nicolai

    Thanks for reporting the issue. Which version of Umbraco are you running?

    I see the issue in Umbraco v 7.4.x .. but not in v. 7.2.x and 7.3.x .. Not sure when it has been broken - I think it is because some restrictions to the upload made in Umbraco, which may affect the fileupload I use in my package to import/export palettes.

    But I noticed it seems Umbraco use same Angular upload directive, so it might be the reason why it now has some issues. https://github.com/umbraco/Umbraco-CMS/blob/24f38e0c0e73e0246fd7cff1ffb77bc001d56069/src/Umbraco.Web.UI.Client/src/views/components/upload/umb-file-dropzone.html

    I will take a look at it..

    /Bjarne

  • Nicolai Sørensen 42 posts 66 karma points
    Mar 30, 2016 @ 18:08
    Nicolai Sørensen
    0

    Hi Bjarne,

    I think you are right. I have tested it on 7.4.1 and latest.

  • Bjarne Fyrstenborg 1257 posts 3802 karma points MVP 5x c-trib
    Mar 30, 2016 @ 18:17
    Bjarne Fyrstenborg
    0

    I also got the following error in v.7.4.0

    (Only allowed file types are: "!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.!.")
    

    In v. 7.2.2 however I get this error when I upload some images:

    (Only allowed file types are: "!.ashx,!.aspx,!.ascx,!.config,!.cshtml,!.vbhtml,!.asmx,!.air,!.axd,!.swf,!.xml,!.html,!.htm,!.svg,!.php,!.htaccess")
    

    enter image description here

    It seems to match the restricted files: https://our.umbraco.org/forum/core/general/57850-Restricting-file-types-that-can-be-uploaded-to-the-back-office-media-section

    <!-- 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,swf,xml,html,htm,svg,php,htaccess</disallowedUploadFiles>
    

    It is a bit strange it add "!" in front of each file extension...

    In the directive in Color Palettes in allow .json and .txt upload:

    <button class="btn btn-small" type="file" ngf-select="uploadFiles($file)" ngf-pattern="'.json,.txt'" accept="text/*" ngf-max-size="1MB">
                <i class="icon icon-page-up"></i> Import Palettes
    </button>
    
  • Nicolai Sørensen 42 posts 66 karma points
    Mar 30, 2016 @ 18:23
    Nicolai Sørensen
    0

    In the config the files are with ! in front, you think it will fix it to remove it?

  • Bjarne Fyrstenborg 1257 posts 3802 karma points MVP 5x c-trib
    Mar 30, 2016 @ 18:32
    Bjarne Fyrstenborg
    0

    No, the config files just list the files like this:

    but I don't know why it add "!" in front of each file extension in the error message.

    It doesn't seems to make a difference whether I add "jpg" to the list or not.

  • Nicolai Sørensen 42 posts 66 karma points
    Mar 30, 2016 @ 18:37
    Nicolai Sørensen
    0

    You are right, it is added in the umbraco.controller.js two places

    //instead of passing in a whitelist, we pass in a blacklist by adding ! to the ext
    vm.acceptedFileTypes = mediaHelper.formatFileTypes(Umbraco.Sys.ServerVariables.umbracoSettings.disallowedUploadFiles).replace(/./g, "!.");
    
  • Bjarne Fyrstenborg 1257 posts 3802 karma points MVP 5x c-trib
    Apr 03, 2016 @ 12:39
    Bjarne Fyrstenborg
    0

    Hi Nicolai

    In Umbraco 7.4.x ng-file-upload is also included in core, so actually it is not needed to include it in my package. However with this fix for v. 7.4.3 it should work even with ng-file-upload included https://github.com/umbraco/Umbraco-CMS/commit/d8c781f97f344792b2d21936605f2045baa112cf

    You can try with this build: https://ci.appveyor.com/project/Umbraco/umbraco-cms-hs8dx/build/3488/artifacts

    But for Umbraco 7.4.0 - 7.4.2 it should work if you exclude ng-file-upload in package.manifest Just remove or uncomment this line:

    "~/App_Plugins/ColorPalettes/modules/ng-file-upload.js"
    

    Can you test if that works for you?

    /Bjarne

  • Chriztian Steinmeier 2737 posts 8401 karma points MVP 5x admin c-trib
    Apr 27, 2016 @ 11:40
    Chriztian Steinmeier
    0

    Worked for me in 7.4.1 - Man, I was getting a lot of "why????" mails from the client :-)

    /Chriztian

Please Sign in or register to post replies

Write your reply to:

Draft