I have a task to limit the amount of the uploaded files in the particular media folders, but I couldn't find any built-in solution for that in Umbraco CMS.
It should display some message, when user has reached the limit 10 files in the media folder, like "Please delete useless files first" and should prohibit the uploading of the new files.
Is it possible to implement such things?
P.S. Umbraco version 7.12.2 assembly: 1.0.6820.12881
I haven't come across such a scenario. However I can give you some directions based on Casper's post on a related query.
You have to write a custom validation on MediaService.Save event to check for the no of files already in the folder and then showing a message for the user.
File amount limit in the Media Folder
Hi guys,
I have a task to limit the amount of the uploaded files in the particular media folders, but I couldn't find any built-in solution for that in Umbraco CMS.
It should display some message, when user has reached the limit 10 files in the media folder, like "Please delete useless files first" and should prohibit the uploading of the new files.
Is it possible to implement such things?
P.S. Umbraco version 7.12.2 assembly: 1.0.6820.12881
I haven't come across such a scenario. However I can give you some directions based on Casper's post on a related query.
You have to write a custom validation on MediaService.Save event to check for the no of files already in the folder and then showing a message for the user.
https://our.umbraco.com/forum/using-umbraco-and-getting-started/80916-media-upload-validation#comment-258766
I will give it try if i get sometime free over this weekend and let you know.
Thank you Veerapandiyan,
I will look at that solution to check the amount of the files in the folder.
But also would be nice to know the way to display some message user and hide/delete "Upload" button in case when file amount limit was reached.
Which service can achieve that?
Have implemented with the following way:
And it works like this:
is working on a reply...