set max upload file size

parent aceca535
......@@ -12,6 +12,7 @@ return [
'file_upload' => [
'tmp_path' => 'data/tmp',
'target_path' => 'data/uploads',
'max_size' => '5MB',
],
],
];
......@@ -218,10 +218,12 @@ return function (Slim\App $app) {
$container[InputFilter\Lab::class] = function ($c) {
$settings = $c->get('settings');
$uploadTmpPath = $settings['schools']['file_upload']['tmp_path'];
$attachmentSize = $settings['schools']['file_upload']['max_size'];
return new InputFilter\Lab(
$uploadTmpPath,
$c->get(Service\LabServiceInterface::class)
$c->get(Service\LabServiceInterface::class),
$attachmentSize
);
};
......
......@@ -22,7 +22,8 @@ class Lab
public function __construct(
$uploadTmpPath,
LabServiceInterface $labService
LabServiceInterface $labService,
$attachmentSize
) {
$id = new Input('id');
$id->setRequired(false)
......@@ -82,6 +83,9 @@ class Lab
'image/svg+xml',
'image/svg+xml',
'image/vnd.adobe.photoshop',
]))
->attach(new Validator\File\Size([
'max' => $attachmentSize,
]));
$use_ext_program= new Input('use_ext_program');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment