Merge pull request #823 from edx/jkarni/feature/multiple-assets-upload

Add support for multiple file uploads
This commit is contained in:
jkarni
2013-09-09 06:47:58 -07:00
5 changed files with 85 additions and 29 deletions

View File

@@ -149,14 +149,14 @@ def upload_asset(request, org, course, coursename):
logging.error('Could not find course' + location)
return HttpResponseBadRequest()
if 'file' not in request.FILES:
if 'files[]' not in request.FILES:
return HttpResponseBadRequest()
# compute a 'filename' which is similar to the location formatting, we're
# using the 'filename' nomenclature since we're using a FileSystem paradigm
# here. We're just imposing the Location string formatting expectations to
# keep things a bit more consistent
upload_file = request.FILES['file']
upload_file = request.FILES['files[]']
filename = upload_file.name
mime_type = upload_file.content_type