-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MaxFileCount improperly checked #25
Comments
fix bounds check for maxFileCount to allow for uploading 1 file
I added this test, but couldn't reproduce the issue: If you can reproduce the issue with that code, let me know which browser and OS you are using, it is then probably an environment issue. |
Hmm. I see the problem when I try to select or drop a second file, after handling the first file. I thought I reset things on the server, maybe I missed a step, or the client doesn't clear its file list after the server handles an upload? My use case is the same component is used multiple times for uploading single files and handling them immediately. Might I have to destroy the component and replace it logically in the UI after every upload? The reason for the single file limit is that it is always replacing the contents of a specific data object, not adding new ones, so only one file makes sense. |
Ok, so I guess we'd need some sort of "reset()" or "clear()" method for MultiFileUpload? That could be handy. Will you create a new enhancement issue for that? Replacing the old component with a new one is probably a decent workaround until the reset method is added. |
VMultiUpload.submit() contains this line:
} else if (maxFileCount != null && filedetails.size() >= maxFileCount) {
This means if you set maxFileCount = 1 and 1 file is selected, it thinks that's too many files!
Should be strictly greater than, not greater or equal.
And yes, it's a multi-file upload and I'm limiting it to one file for a special case. I needed drag and drop.
The text was updated successfully, but these errors were encountered: