Copied to clipboard

Flag this post as spam?

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


  • Tom 713 posts 954 karma points
    Jan 21, 2014 @ 02:37
    Tom
    0

    Validate File Upload Size?

    Hi I was just wondering if it's possible to validate file upload size in contour? has anyone done this with a custom workflow or is there something out of the box? I'm basically looking for a hook in point if it's possible?

     

    I tried having a look at Code First forms in v3 but when I override Validate with:

     

    public override IEnumerable<Exception> Validate()

    It is never called on form submission when debugging

     

    Trying to find documentation on the field types is also a bit difficult i.e. how would I check the input size of MrFile when MrFile is a string.. And how would we do drop downs with pre-values?:

    [Field(FormPages.MrPage, FormFieldsets.Details,

    Type = typeof(FileUpload))]

    public string MrFile{ get; set; } 

     

     

    Thanks

  • Comment author was deleted

    Jan 21, 2014 @ 09:22

    You could do this client side, if you look for some examples it should be easy to port into a fieldtype(or just by adding some js to an existing contour form)

  • Tom 713 posts 954 karma points
    Jan 21, 2014 @ 23:20
    Tom
    0

    I thought you could only do it in a pretty hacky way client side in modern browsers only.

     

    Any chance you know why the override for Validate isn't firing?

     

  • Comment author was deleted

    Jan 22, 2014 @ 11:20

    Validate should fire, but make sure you are using the razor macro since usercontrol doesn't support it

  • Tom 713 posts 954 karma points
    Jan 22, 2014 @ 22:57
    Tom
    0

    Ohh i see and what if you're inserting in to rich text in a master page? will that use a user control macro?

  • Tom 713 posts 954 karma points
    Mar 21, 2014 @ 06:43
    Tom
    0

    Just wondering if there is going to be some kind of provision for this in later version of contour? even the ability to redirect to an error page or postback with a flag if the upload contents exceed maxRequestLength?

  • Tom 713 posts 954 karma points
    Mar 21, 2014 @ 06:43
    Tom
    0

    Just wondering if there is going to be some kind of provision for this in later version of contour? even the ability to redirect to an error page or postback with a flag if the upload contents exceed maxRequestLength?

  • Comment author was deleted

    Mar 21, 2014 @ 11:16

    Well you could create a custom field type that takes care of providing feedback, no plans atm to include that but could you add it to issue tracker as a feature request? http://issues.umbraco.org/issues/CON

Please Sign in or register to post replies

Write your reply to:

Draft