Skip to content
Snippets Groups Projects
Commit a7305d14 authored by Martin Mareš's avatar Martin Mareš
Browse files

Jobs: Dávka se stahuje s Content-Disposition: attachment a jménem

parent 17691b80
No related branches found
No related tags found
1 merge request!9WIP: Zárodek uživatelské části webu a submitování
...@@ -85,7 +85,10 @@ def send_job_result(job: db.Job) -> Response: ...@@ -85,7 +85,10 @@ def send_job_result(job: db.Job) -> Response:
type = 'application/binary' type = 'application/binary'
if os.path.isfile(file): if os.path.isfile(file):
return send_file(file, mimetype=type) return send_file(file,
mimetype=type,
as_attachment=True,
attachment_filename=job.out_file)
else: else:
logger.error(f'Soubor {file} je výsledkem jobu, ale ve FS neexistuje') logger.error(f'Soubor {file} je výsledkem jobu, ale ve FS neexistuje')
raise werkzeug.exceptions.NotFound() raise werkzeug.exceptions.NotFound()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment