We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When you set
fileUploader.setMaxFiles(2);
and you have set up a maxFilesReachHandler:
fileUploader.addMaxFilesReachHandler(event -> {MessageUtils.showMessage("too many files");});
Then you try to upload 3 files, you will never see the message.
Reason: An exception is thrown in MaterialFileUploader.convertUploadFile()
Double.parseDouble(file.size)
as file.size is null for the file exceeding the maxfile limit, the parseDouble method fails.
Something like this is needed:
double fileSize = file.size != null ? Double.parseDouble(file.size) : 0;
There are even more bugs concerning the exceeding maxFiles. E.g.
uploader.on(FileUploaderEvents.COMPLETE, file -> { String message = getResponseMessage(globalResponse); CompleteEvent.fire(this, convertUploadFile(file), new UploadResponse(file.xhr.status, file.xhr.statusText, message)); });
Here as well file.xhr is null for the 'maxFiles exceeding' file and therefore file.xhr.status will cause a NPE
The text was updated successfully, but these errors were encountered:
Thanks will be looking into this, if you have time to submit a PR then it will be much appreciated.
Sorry, something went wrong.
No branches or pull requests
When you set
fileUploader.setMaxFiles(2);
and you have set up a maxFilesReachHandler:
fileUploader.addMaxFilesReachHandler(event -> {MessageUtils.showMessage("too many files");});
Then you try to upload 3 files, you will never see the message.
Reason:
An exception is thrown in MaterialFileUploader.convertUploadFile()
Double.parseDouble(file.size)
as file.size is null for the file exceeding the maxfile limit, the parseDouble method fails.
Something like this is needed:
double fileSize = file.size != null ? Double.parseDouble(file.size) : 0;
There are even more bugs concerning the exceeding maxFiles. E.g.
Here as well file.xhr is null for the 'maxFiles exceeding' file and therefore file.xhr.status will cause a NPE
The text was updated successfully, but these errors were encountered: