There’s a page in my app where the user must add one or more files to proceed and I’m using a RG in order to create an interface showing the files already uploaded, but there are 2 similar problems I’m facing and can’t seem to solve them.
First one is that the interface for this plugin is pretty ugly, so I want to want to reset the input but keep the files uploaded. The way I’m trying to do it is by creating a custom state on the page that stores these files and then reseting the input so it doesn’t have those ugly green buttons.
The thing is, the first file is added correctly, but when I try to upload a second one, the second file overwrites the first one.
I’ve noticed that this doesn’t happen if I don’t reset the input, but I can’t figure out why.
The second problem also involves reseting the input but it’s a bit more important, as it isn’t just about the interface. I have to limit the extension of the uploaded files. I know how to do it on the regular uploader just fine, but it can’t seem to do it on the multi-file one.
The steps that I take in order to verify the extension are: Check if the file name has a forbidden extension once the file uploader values change, then delete the uploaded file and clear the input, but if I do this, all the other files on the uploader are also cleared.
Thank you in advance.