I have created simple portlet using caf and used File Input control for upload file. And trying to upload large file, more than 20MB files.
When I upload more than 20MB size file, receiving error like Request exceeds maxRequestSize (20971520) from the portlet.
And here is the web.xml content - I have increased the MAX_UPLOAD_DISK_SIZE param value to 30 MB.
Handles multipart form POSTs (file uploads); required by FileInput control.
Max allowed upload size in bytes (defaults to "10 MB").
Looks like, its not taking the value from web.xml.
Could you please help me, what other parameters I should change in order to upload more than 20 MB file?
Keep in mind that all requests from a portlet are dispatched through the main MWS servlet context, not directly through the portlet application servlet context. So those settings from the web.xml of your CAF application would not be used for processing the uploaded files. The main MWS servlet context would have already processed the uploaded files before the processing is passed on to the portlet.
Those settings from your CAF application’s web.xml file would only be utilized for standalone (non-portlet) use cases.
To set the maximum file size for portlet requests, you can follow this procedure that was described in the admin guide documentation:
- As system administrator: Administration Dashboard > Content > Content Service > Set Publish Constraints.
- In the Max Publish Size (MB) field, type a maximum publish size (in Megabytes).
- Click Apply.
However, keep in mind that allowing your uses to upload very large files increases the risk of a denial of service attack on your server so set the limit cautiously.
Thanks a lot for your quick response with the detailed information.
I did the change accordingly and now I am able to upload more than 20MB size file through my portlet.
Also I will make sure about setting maximum size (for upload very large file), since its global parameter not specific to project.(as you have mentioned).