diff --git a/portal/service/submissions.py b/portal/service/submissions.py index 16f5de525fd145a0cf550e51b8183f4adf72d1a3..2e86b17c6a29bb3876de61ef11915bb74e37cf1e 100644 --- a/portal/service/submissions.py +++ b/portal/service/submissions.py @@ -152,11 +152,13 @@ def send_zip(storage_submission: entities.Submission): def send_selected_file(storage_submission: entities.Submission, path_query: str): - path = storage_submission.path / Path(path_query) + path_query = Path(path_query) + path = (storage_submission.path / path_query) + path = path.absolute() if not path.exists(): raise errors.PortalAPIError(400, f"Requested path does not exist: {path}") log.debug(f"[SEND] Sending file for submission ({storage_submission.entity_id}): {path}") - return flask.send_file(str(path)) + return flask.send_file(str(path), attachment_filename=path.name) def send_file_or_zip(storage_entity):