3

In my project, I will allow users to send zip files and images files (on two different form post).

The project is developed with Play! Framework (not PHP).

I'd like to limit the size of upload for 1MB if it's images, and 10MB if it's zip.

Is this possible?

I saw the directive client_max_body_size that should do what I'm looking for, but I can't find a way to apply this per mimetype.

Stuggi
  • 3,366
  • 4
  • 17
  • 34
Cyril N.
  • 574
  • 1
  • 9
  • 33

1 Answers1

1

You can create different locations whith different client_max_body_size (or anything you want) for images, zips and etc.

just use:

location ~* ^.+\.(jpg|jpeg|gif) {

client_max_body_size 1m;
...proxy_pass or whatever
}

location ~* ^.+\.(zip|rar) {
client_max_body_size 10m;
...proxy_pass or whatever

}
Stuggi
  • 3,366
  • 4
  • 17
  • 34
unlo
  • 454
  • 3
  • 8