-
Notifications
You must be signed in to change notification settings - Fork 139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Previous submission file #1016
base: master
Are you sure you want to change the base?
Previous submission file #1016
Conversation
need to reminified js |
@@ -762,7 +762,7 @@ function load_input_file(submissionid, key, input) | |||
var input_file = $('#download-input-file-' + key); | |||
input_file.attr('href', url ); | |||
input_file.css('display', 'block'); | |||
if(allowed_exts.indexOf(".pdf") >= 0) { | |||
if(input[key]["filename"].endsWith('.pdf')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can remove the allowed_ext
definition if it is not used anymore.
Apart from this, where is load_input_file()
used ?
if not filename.lower().endswith(".pdf"): | ||
headers = { | ||
'Content-Disposition': f'attachment; filename="{filename}"' | ||
} | ||
return Response(response=file_content, content_type=mime_type[0], headers=headers) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why having a difference in behavior if the file is a PDF ? I think the best is to download it as any other file.
Remove file preview if non pdf file.
Replace download button action by downloading the file instead of displaying it in the browser which can lead to some issues (#868)