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
577c47f9
Commit
577c47f9
authored
Aug 13, 2012
by
kimth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
LMS-side MAX_FILESIZE set in settings.py
parent
12a254f0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
6 deletions
+4
-6
lms/djangoapps/courseware/module_render.py
+3
-6
lms/envs/common.py
+1
-0
No files found.
lms/djangoapps/courseware/module_render.py
View file @
577c47f9
...
@@ -337,17 +337,14 @@ def modx_dispatch(request, dispatch=None, id=None, course_id=None):
...
@@ -337,17 +337,14 @@ def modx_dispatch(request, dispatch=None, id=None, course_id=None):
'''
'''
# ''' (fix emacs broken parsing)
# ''' (fix emacs broken parsing)
# TODO: Should be in settings.py
# Check for submitted files and basic file size checks
MAX_UPLOAD_FILE_SIZE
=
4
*
1000
*
1000
# 4 MB
# Check for submitted files
p
=
request
.
POST
.
copy
()
p
=
request
.
POST
.
copy
()
if
request
.
FILES
:
if
request
.
FILES
:
for
inputfile_id
in
request
.
FILES
.
keys
():
for
inputfile_id
in
request
.
FILES
.
keys
():
inputfile
=
request
.
FILES
[
inputfile_id
]
inputfile
=
request
.
FILES
[
inputfile_id
]
if
inputfile
.
size
>
MAX_UPLOAD_FILE_SIZE
:
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)'
%
\
file_too_big_msg
=
'Submission aborted! Your file "
%
s" is too large (max size:
%
d MB)'
%
\
(
inputfile
.
name
,
MAX_UPLOAD_FILE
_SIZE
/
(
1000
**
2
))
(
inputfile
.
name
,
settings
.
STUDENT_FILEUPLOAD_MAX
_SIZE
/
(
1000
**
2
))
return
HttpResponse
(
json
.
dumps
({
'success'
:
file_too_big_msg
}))
return
HttpResponse
(
json
.
dumps
({
'success'
:
file_too_big_msg
}))
p
[
inputfile_id
]
=
inputfile
p
[
inputfile_id
]
=
inputfile
...
...
lms/envs/common.py
View file @
577c47f9
...
@@ -128,6 +128,7 @@ TEMPLATE_CONTEXT_PROCESSORS = (
...
@@ -128,6 +128,7 @@ TEMPLATE_CONTEXT_PROCESSORS = (
'django.core.context_processors.csrf'
,
#necessary for csrf protection
'django.core.context_processors.csrf'
,
#necessary for csrf protection
)
)
STUDENT_FILEUPLOAD_MAX_SIZE
=
4
*
1000
*
1000
# 4 MB
# FIXME:
# FIXME:
# We should have separate S3 staged URLs in case we need to make changes to
# 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