Copied to clipboard

Flag this post as spam?

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


  • devore_uk 13 posts 2 karma points
    Jun 03, 2009 @ 13:41
    devore_uk
    0

    Validation field on document type

    Hi all,

    New to Umbraco and already a big fan but I'm having a really frustrating problem. I'm adding validation to an upload field. I started with:

    ([a-zA-Z1-9]).(((j|J)(p|P)(g|G))|((p|P)(n|N)(g|G)))

    Which works great. Then I added '/-' because some of the files have dashes:

    ([/-a-zA-Z1-9]
    ).(((j|J)(p|P)(g|G))|((p|P)(n|N)(g|G)))

    This doesn't work #-o

    I've also been testing this to add support for GIFs:

    ([a-zA-Z1-9]*).(((j|J)(p|P)(g|G))|((p|P)(n|N)(g|G))|((g|G)(i|I)(f|F)))

    This also doesn't work #-o

    All help appreciated!



  • devore_uk 13 posts 2 karma points
    Jun 03, 2009 @ 16:25
    devore_uk
    0

    Seem to have fixed it. It appears to me (I might be wrong) but I am validating the url to the file once uploaded not the filename itself. This lead to all sorts of crazy behaviour e.g. supporting spaces meant adding %20 matching!

    I seem to have everything working now. On a completely different node if anyone know how to add a control that uploads image and validates the image dimensions please let me know.

  • Chau 66 posts 97 karma points
    Oct 02, 2009 @ 22:07
    Chau
    0

    Did you ever find a solution to this. I would like to add an image upload size validation too.

  • 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