07-20-2023, 02:47 PM
How to limit file size in uploads in <a href="http://wicket.apache.org/">Apache Wicket</a> version 1.4?
I am using <a href="http://wicket.apache.org/docs/1.4/org/apache/wicket/markup/html/form/upload/FileUploadField.html">FileUploadField</a> to handle upload with normal form submit without any Ajax stuff. Is it enough to use <a href="http://wicket.apache.org/docs/1.4/org/apache/wicket/markup/html/form/Form.html#getMaxSize()">Form.setMaxSize()</a> to limit the size of uploaded file?
If too large file is uploaded, the browser will upload the whole file and Wicket will create validation error message with key `[form-id].uploadTooLarge`.
But how Wicket internally handles this situation, creating temporary files etc?
I'd like to prevent a case where user uploads file of several GBs that doesn't fit to memory or disk while Wicket handles the request.
I am using <a href="http://wicket.apache.org/docs/1.4/org/apache/wicket/markup/html/form/upload/FileUploadField.html">FileUploadField</a> to handle upload with normal form submit without any Ajax stuff. Is it enough to use <a href="http://wicket.apache.org/docs/1.4/org/apache/wicket/markup/html/form/Form.html#getMaxSize()">Form.setMaxSize()</a> to limit the size of uploaded file?
If too large file is uploaded, the browser will upload the whole file and Wicket will create validation error message with key `[form-id].uploadTooLarge`.
But how Wicket internally handles this situation, creating temporary files etc?
I'd like to prevent a case where user uploads file of several GBs that doesn't fit to memory or disk while Wicket handles the request.