Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
gredu_labs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Σταύρος Παπαδάκης
gredu_labs
Commits
19834368
Commit
19834368
authored
Mar 15, 2016
by
Vassilis Kanellopoulos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
set max upload file size
parent
aceca535
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
2 deletions
+9
-2
config/settings/schools.global.php
config/settings/schools.global.php
+1
-0
module/schools/bootstrap.php
module/schools/bootstrap.php
+3
-1
module/schools/src/InputFilter/Lab.php
module/schools/src/InputFilter/Lab.php
+5
-1
No files found.
config/settings/schools.global.php
View file @
19834368
...
...
@@ -12,6 +12,7 @@ return [
'file_upload'
=>
[
'tmp_path'
=>
'data/tmp'
,
'target_path'
=>
'data/uploads'
,
'max_size'
=>
'5MB'
,
],
],
];
module/schools/bootstrap.php
View file @
19834368
...
...
@@ -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
);
};
...
...
module/schools/src/InputFilter/Lab.php
View file @
19834368
...
...
@@ -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'
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment