Copied to clipboard

Flag this post as spam?

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


  • Sherry Ann Hernandez 320 posts 344 karma points
    Feb 28, 2011 @ 16:01
    Sherry Ann Hernandez
    0

    Is there a way to validate the image size and dimension?

    Can anybody help me how to add the validation?

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Feb 28, 2011 @ 16:07
    Jan Skovgaard
    0

    Hi Sherry

    Where do you want to add the validation?

    I guess you could make a check using XSLT to see if the width and height match the required values then it's inserted, otherwise it's not.

    You could also use imageGen to ensure images are scaled to fit the proper dimensions perhaps?

    Please tell us a bit more about what you have on your mind.

    /Jan

  • Sherry Ann Hernandez 320 posts 344 karma points
    Mar 01, 2011 @ 06:22
    Sherry Ann Hernandez
    0

    Hi Jan,

    I want to validate it during upload. When I clicked on the save button it should not proceed once it detects the image size is more than 120kb.

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Mar 01, 2011 @ 08:18
    Jan Skovgaard
    0

    Hi Sherry

    I guess it should be possible to hook into the BeforeSave event and check the file size of the file uploaded and cancel it if it ecxeeds the limit specified. I must admit that I'm not able to provide you with any sample code for this...but maybe some others in here are :)

    /Jan

  • Sherry Ann Hernandez 320 posts 344 karma points
    Mar 01, 2011 @ 08:25
    Sherry Ann Hernandez
    0

    But I can't find the BeforeSave event in the data editor. There is only OnSave event.

    I was trying to add a validator also but I have no idea how to hook it up the label control that is used in media.

Please Sign in or register to post replies

Write your reply to:

Draft