Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cms/djangoapps/contentstore/features/upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def upload_file(_step, file_name):
#uploading the file itself
path = os.path.join(TEST_ROOT, 'uploads/', file_name)
world.browser.execute_script("$('input.file-input').css('display', 'block')")
world.browser.attach_file('files[]', os.path.abspath(path))
world.browser.attach_file('file', os.path.abspath(path))
close_css = 'a.close-button'
world.css_click(close_css)

Expand All @@ -43,7 +43,7 @@ def upload_file(_step, files_string):
for f in files:
path = os.path.join(TEST_ROOT, 'uploads/', f)
world.browser.execute_script("$('input.file-input').css('display', 'block')")
world.browser.attach_file('files[]', os.path.abspath(path))
world.browser.attach_file('file', os.path.abspath(path))
close_css = 'a.close-button'
world.css_click(close_css)

Expand Down
4 changes: 2 additions & 2 deletions cms/djangoapps/contentstore/views/assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,14 +149,14 @@ def upload_asset(request, org, course, coursename):
logging.error('Could not find course' + location)
return HttpResponseBadRequest()

if 'files[]' not in request.FILES:
if 'file' 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['files[]']
upload_file = request.FILES['file']
filename = upload_file.name
mime_type = upload_file.content_type

Expand Down
2 changes: 1 addition & 1 deletion cms/templates/asset_index.html
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ <h1>${_("Upload New File")}</h1>
<form class="file-chooser" action="${upload_asset_callback_url}"
method="post" enctype="multipart/form-data">
<a href="#" class="choose-file-button">${_("Choose File")}</a>
<input type="file" class="file-input" name="files[]" multiple>
<input type="file" class="file-input" name="file" multiple>
</form>
</div>
</div>
Expand Down