Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
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
edx
edx-platform
Commits
3c0ec13c
Commit
3c0ec13c
authored
Aug 19, 2012
by
kimth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Limit number of files that can be uploaded at once
parent
739e5845
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
0 deletions
+7
-0
lms/djangoapps/courseware/module_render.py
+6
-0
lms/envs/common.py
+1
-0
No files found.
lms/djangoapps/courseware/module_render.py
View file @
3c0ec13c
...
...
@@ -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)'
%
\
...
...
lms/envs/common.py
View file @
3c0ec13c
...
...
@@ -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
...
...
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