When I upload large files (greater than 1 MB) in play framework 2.0 I get
"413 Request Entity Too Large" error.
Could you please anybody suggest how to get rid of this?
Thanks,
UPDATE I have solved this issue by adding this to application.conf
#Set Max file sizeparsers.MultipartFormData.maxLength=10240K
The upload module limits the size of a single attachment to be less than either post_max_size, or upload_max_filesize, whichever is smaller. The default PHP values are 2 MB for upload_max_filesize, and 8 MB for post_max_size.
As implemented, the maximum NTFS file size is 16 TB. With Windows 8, the maximum NTFS file size is 256 TB.
The filesize limit for using the Load Table Utility in the GUI is actually 50MB, as is pretty clearly spelled out in this article.
See http://www.playframework.com/documentation/2.0.x/ScalaBodyParsers
or Java version: http://www.playframework.com/documentation/2.0.x/JavaBodyParsers
extract:
// Accept only 10KB of data. def save = Action(parse.text(maxLength = 1024 * 10)) { request => Ok("Got: " + text) }
And you can configure this in your application.conf
using parsers.text.maxLength
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With