Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Max file upload size in Play framework 2.0

Tags:

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 size

parsers.MultipartFormData.maxLength=10240K

like image 350
Amirtharaj Vellingiri Avatar asked Jul 04 '12 10:07

Amirtharaj Vellingiri


People also ask

What is the maximum file size for upload?

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.

What is the file size limit?

As implemented, the maximum NTFS file size is 16 TB. With Windows 8, the maximum NTFS file size is 256 TB.

What is the maximum file upload size when using the GUI?

The filesize limit for using the Load Table Utility in the GUI is actually 50MB, as is pretty clearly spelled out in this article.


1 Answers

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.

like image 119
gre Avatar answered Oct 12 '22 10:10

gre