Is it possible to limit the total number of files a user can upload? I've implemented code which is working to hide the "Add more" button but I'm wondering about limiting the number of files a user can upload through the WordPress uploader. Is that possible or do you have any suggestions on how to achieve that?
Hello. Thank you for contacting the Toolset support.
As I understand you are using media uploader to upload the images and you want to limit the number of files to be uploaded in backend or using Toolset forms?
Yes, that is correct. The issue I'm having is that a user can upload unlimited images since the WordPress media manager allows for multiple uploads at one time – even if I limit the number of repeater fields they can add via the jQuery I've added.
I tried the code you suggested here (hidden link) but it didn't seem to work. Any help refining that code might help.
I've already implemented the last suggestion you made but the issue is that when the multi-instance option is turned on you can upload as many images as you want even if you can only add six instances of a field.
I've already implemented the last suggestion you made but the issue is that when the multi-instance option is turned on you can upload as many images as you want even if you can only add six instances of a field.
==>
Regarding this, what if we hide :Add New button once user reach to 6th instance of the repeating field?
Or you are saying even if we hide the "Add New" button after six instance but using media uploader users are still able to upload multiple images?
Yes, "Or you are saying even if we hide the "Add New" button after six instance but using media uploader users are still able to upload multiple images?" is exactly what is happening. Even though the "Add new" button is limited to 6 the user can upload as many media files as they want through the wordpres media manager.
We are trying to avoid this to keep the number of files smaller instead of letting users just upload as many as they want.
Toolset uses the WordPress standard media uploader and I do not think if media uploader offers any limits.
As of now I do not have any workaround or solution to offer you, if you stop using media uploader then I will have a solution for you or you will have to wait a bit and allow me some time to find workaround (if possible) as I need to debug big deep but I do not promise that I will have a solution to offer. I will just give a try when I get some time. Let me know if that is OK for you.