Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
MBetterd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Mbetter
MBetterd
Commits
b5659db5
Commit
b5659db5
authored
Sep 26, 2025
by
Stefy Lanza (nextime / spora )
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Still fix for max file upload size
parent
b840a724
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
file_handler.py
app/upload/file_handler.py
+1
-1
security.py
app/utils/security.py
+2
-2
No files found.
app/upload/file_handler.py
View file @
b5659db5
...
...
@@ -73,7 +73,7 @@ class FileUploadHandler:
file
.
seek
(
0
)
if
not
validate_file_size
(
file_size
):
max_size_mb
=
current_app
.
config
.
get
(
'MAX_CONTENT_LENGTH'
,
5
*
1024
*
1024
*
1024
)
max_size_mb
=
current_app
.
config
.
get
(
'MAX_CONTENT_LENGTH'
,
5
*
1024
*
1024
*
1024
)
//
(
1024
*
1024
)
return
False
,
f
"File too large. Maximum size: {max_size_mb}MB"
return
True
,
None
...
...
app/utils/security.py
View file @
b5659db5
...
...
@@ -297,7 +297,7 @@ def validate_file_size(file_size, max_size=None):
bool: True if file size is acceptable
"""
if
max_size
is
None
:
max_size
=
current_app
.
config
.
get
(
'MAX_CONTENT_LENGTH'
,
5
00
*
1024
*
1024
)
max_size
=
current_app
.
config
.
get
(
'MAX_CONTENT_LENGTH'
,
5
*
1024
*
1024
*
1024
)
return
file_size
<=
max_size
...
...
@@ -379,4 +379,4 @@ class SecurityHeaders:
"font-src 'self'; "
"connect-src 'self'"
)
return
response
\ No newline at end of file
return
response
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