struts2 FileUploadInterceptor fires too late to verify file size and file
extension
I can't seem to figure out how to properly use FileUploadInterceptor in
struts2. I have everything wired and it does work. I can specify the file
extensions and max file size and it indeed works. The problem is as
follows:
I specify the max file size as 100mb
When user uploads 110mb the file I can see that JakartaMultiPartRequest
class handles the file upload with the help common fileupload libraries.
This happens BEFORE the file upload interceptor.
Once the user waited for minutes and the file upload is done the file
upload interceptor fires and tells the user that the file is too big.
There is something wrong with sequence of events. I would like to looks at
content-length header and right away tell the user that the file is too
big (before uploading). I understand the header is not always there but if
it is there I would like to use it.
Other than overwriting JakartaMultiPartRequest class I don't understand
how to do this.
Thank you for your help
No comments:
Post a Comment