FileUpload with result possible? [message #1860864] |
Wed, 06 September 2023 15:57 |
Eclipse User |
|
|
|
Hi,
in our application we use the FileUpload component to upload a file or files to our backend application server.
Our RAP-based web-application has a filter configured, which will scan for both the actual file type of whatever is to be uploaded and also can submit the data that is uploaded to a malware scanner. We use clamav.
Only when the uploaded data passes the scan, the filter will forward the data to the URL of the upload service handler.
If it does not pass, the filter will send an error reponse with status code 406.
It would be nice, to be notified by the FileUpload widget that the upload attempt failed. Because a call to the form submit() method seems to be used to upload the file, the response is lost, though.
Wouldn't it be possible to implement the FileUpload using the fetch() api instead? This would return the response in a promise !?
An alternative approach in our case would be to install a second service handler in the servlet where a "bad" request might be redirected to or to add some header to the filtered request which would tell the service handler that the payload is infected.
What do you think?
Best regards
Gunnar Adams
|
|
|
Powered by
FUDForum. Page generated in 0.04213 seconds