Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
2f63a9b4
Commit
2f63a9b4
authored
12 years ago
by
kimth
Browse files
Options
Downloads
Patches
Plain Diff
Limit number of files that can be uploaded at once
parent
20adaa81
Loading
Loading
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lms/djangoapps/courseware/module_render.py
+6
-0
6 additions, 0 deletions
lms/djangoapps/courseware/module_render.py
lms/envs/common.py
+1
-0
1 addition, 0 deletions
lms/envs/common.py
with
7 additions
and
0 deletions
lms/djangoapps/courseware/module_render.py
+
6
−
0
View file @
2f63a9b4
...
...
@@ -379,6 +379,12 @@ def modx_dispatch(request, dispatch=None, id=None, course_id=None):
if
request
.
FILES
:
for
fileinput_id
in
request
.
FILES
.
keys
():
inputfiles
=
request
.
FILES
.
getlist
(
fileinput_id
)
if
len
(
inputfiles
)
>
settings
.
MAX_FILEUPLOADS_PER_INPUT
:
too_many_files_msg
=
'
Submission aborted! Maximum %d files may be submitted at once
'
%
\
settings
.
MAX_FILEUPLOADS_PER_INPUT
return
HttpResponse
(
json
.
dumps
({
'
success
'
:
too_many_files_msg
}))
for
inputfile
in
inputfiles
:
if
inputfile
.
size
>
settings
.
STUDENT_FILEUPLOAD_MAX_SIZE
:
# Bytes
file_too_big_msg
=
'
Submission aborted! Your file
"
%s
"
is too large (max size: %d MB)
'
%
\
...
...
This diff is collapsed.
Click to expand it.
lms/envs/common.py
+
1
−
0
View file @
2f63a9b4
...
...
@@ -141,6 +141,7 @@ TEMPLATE_CONTEXT_PROCESSORS = (
)
STUDENT_FILEUPLOAD_MAX_SIZE
=
4
*
1000
*
1000
# 4 MB
MAX_FILEUPLOADS_PER_INPUT
=
10
# FIXME:
# We should have separate S3 staged URLs in case we need to make changes to
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment