Get access to File Uploader to change number of uploaded files (JS)

I have a form for creating/updating posts with a multi-file upload field. When the user on the front-end clicks by the “Edit post” link, a form appears with all the post’s data filled out, including custom previews of the images previously attached to that post. The Upload field also has a max files limit (6 files), so if there are 4 images attached to a post, the user can only add 2 more. But now all 6 can be added, because custom previews are not counted as just uploaded. So I need to access the Uploader using JS and dynamically change the number of uploaded files from 0 to 4, for example. But not only once, because the user also has the ability to delete images (including previously attached ones) and add new ones. And in this case, when the user deletes a previously attached image (custom preview), I need to be able to change the number of files available for upload based on the total number of files already uploaded (new ones and previously attached to the post).
Hope I have explained clearly.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.