Created
April 9, 2015 12:07
-
-
Save rossriley/bb16ea1b7933292a12a4 to your computer and use it in GitHub Desktop.
How to adjust upload size by contenttype
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$app->initialize(); | |
$app['upload'] = $app->extend('upload', function ($handler, $app) { | |
if ($app['request']->get('contenttype') == 'pages') { | |
$handler->addRule('size', ['size' => '100K'], '{label} uploads are limited to {size}', 'Page Image'); | |
} | |
return $handler; | |
}); | |
$app->run(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Where this code should go in custom extension. Do I also need to change upload size inside PHP ini?