Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
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
76c8e33d
Commit
76c8e33d
authored
9 years ago
by
Christine Lytwynec
Browse files
Options
Downloads
Patches
Plain Diff
Fix file upload in IE
parent
fdf540d2
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lms/djangoapps/django_comment_client/base/views.py
+7
-3
7 additions, 3 deletions
lms/djangoapps/django_comment_client/base/views.py
with
7 additions
and
3 deletions
lms/djangoapps/django_comment_client/base/views.py
+
7
−
3
View file @
76c8e33d
import
functools
import
logging
import
json
import
random
import
time
import
urlparse
...
...
@@ -7,7 +8,7 @@ import urlparse
from
django.contrib.auth.decorators
import
login_required
from
django.contrib.auth.models
import
User
from
django.core
import
exceptions
from
django.http
import
Http404
,
HttpResponseBadRequest
from
django.http
import
Http404
,
HttpResponseBadRequest
,
HttpResponse
from
django.utils.translation
import
ugettext
as
_
from
django.views.decorators
import
csrf
from
django.views.decorators.http
import
require_GET
,
require_POST
...
...
@@ -750,13 +751,16 @@ def upload(request, course_id): # ajax upload file to a question or answer
result
=
''
file_url
=
''
return
JsonResponse
({
# Using content-type of text/plain here instead of JSON because
# IE doesn't know how to handle the JSON response and prompts the
# user to save the JSON as a file instead of passing it to the callback.
return
HttpResponse
(
json
.
dumps
({
'
result
'
:
{
'
msg
'
:
result
,
'
error
'
:
error
,
'
file_url
'
:
file_url
,
}
})
})
,
content_type
=
"
text/plain
"
)
@require_GET
...
...
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