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.
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
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
bump
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
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
is working on a reply...