Copied to clipboard

Flag this post as spam?

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


  • Samuel Buss 8 posts 78 karma points
    Aug 07, 2019 @ 06:21
    Samuel Buss
    0

    Validating upload file name length

    Using Umbraco cloud there is a resrtiction on filename length if you want to restore content between environments. https://our.umbraco.com/documentation/Umbraco-Cloud/Troubleshooting/Deployments/Path-too-long-exception/

    What is the best way to add validation to the file upload, so that editors can't upload invalid filenames? I have looked at hooking up to the Media Saving event, but this occurs after the file has already been uploaded.

    many thanks

  • Samuel Buss 8 posts 78 karma points
    Aug 13, 2019 @ 08:14
    Samuel Buss
    0

    bump

  • Shaishav Karnani from digitallymedia.com 354 posts 1638 karma points
    Aug 13, 2019 @ 10:03
    Shaishav Karnani from digitallymedia.com
    0

    Hi Samuel,

    I think you can do front-end validation. Example code here:-

    https://www.tutorialrepublic.com/faq/how-to-get-selected-file-name-from-input-type-file-using-jquery.php

    This should work for you. Please share your views.

    Cheers,

    Shaishav

  • Samuel Buss 8 posts 78 karma points
    Aug 15, 2019 @ 11:16
    Samuel Buss
    0

    Hi Shaishav, Thanks for your reply. We are using both the FileUpload and ImageCropper property editors in our project to upload media. So I think the correct approach is to create custom versions of both with additional validation including the front-end validation in your suggestion. If you can think of a more straight forward solution, please share. many thanks Sam

  • 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