Merge pull request #22581 from edx/feanil/fix_export_filename
Correct the output file name for exports.
This commit is contained in:
@@ -630,9 +630,6 @@ def create_export_tarball(course_module, course_key, context, status=None):
|
||||
Updates the context with any error information if applicable.
|
||||
"""
|
||||
name = course_module.url_name
|
||||
if isinstance(name, binary_type):
|
||||
name = name.decode('utf-8')
|
||||
|
||||
export_file = NamedTemporaryFile(prefix=name + '.', suffix=".tar.gz")
|
||||
root_dir = path(mkdtemp())
|
||||
|
||||
|
||||
@@ -277,7 +277,7 @@ def send_tarball(tarball, size):
|
||||
"""
|
||||
wrapper = FileWrapper(tarball, settings.COURSE_EXPORT_DOWNLOAD_CHUNK_SIZE)
|
||||
response = StreamingHttpResponse(wrapper, content_type='application/x-tgz')
|
||||
response['Content-Disposition'] = u'attachment; filename=%s' % os.path.basename(tarball.name.encode('utf-8'))
|
||||
response['Content-Disposition'] = u'attachment; filename=%s' % os.path.basename(tarball.name)
|
||||
response['Content-Length'] = size
|
||||
return response
|
||||
|
||||
|
||||
Reference in New Issue
Block a user