Copied to clipboard

Flag this post as spam?

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


  • Dan Evans 631 posts 1018 karma points
    Jun 24, 2013 @ 12:02
    Dan Evans
    0

    CogFiltered Upload for Razor

    Is this Contour datatype that allows filtering uploads by file type available for Razor? Or is there another?

    http://our.umbraco.org/projects/backoffice-extensions/cogworks-cogfilteredupload

  • Comment author was deleted

    Jun 24, 2013 @ 12:04

    Don't think so maybe try getting in touch with Ismail to see if he plans on adding support soon

  • Dan Evans 631 posts 1018 karma points
    Jun 24, 2013 @ 13:58
    Dan Evans
    1

    Thanks Tim. Is there a reason why there is no RegEx field in the standard upload? I've hardcoded one into a custom version in a View which seems to work partially but doesn't like files with capital letters as the file extension:

    @model Umbraco.Forms.Mvc.Models.FieldViewModel
    <input type="file" name="@Model.Name" id="@Model.Id"
    @if(Model.Mandatory){<text> data-val="true" data-val-required="@Model.RequiredErrorMessage"</text>}
    @if(Model.Mandatory){<text> data-val-regex="Invalid file type, only png, jpg and gif allowed" data-regex="^.+\.((jpg)|(gif)|(jpeg)|(png)|(JPG)|(GIF)|(JPEG)|(PNG))$"</text>}
    />
     
    @if (!string.IsNullOrEmpty(Model.Value))
    {
     <br />
     <a href="@Model.Value" target"_blank">Show current file</a>
     <input type="hidden" name="@{@Model.Name}_file" value="@Model.Value"/>
    }
  • 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