fix: Safariブラウザで生物由来ファイルをダウンロードすると、日本語名がおかしくなる問題を修正

This commit is contained in:
shimoda.m@nds-tyo.co.jp 2023-08-22 16:00:02 +09:00
parent a81bfa9d6c
commit 13ee19717c

View File

@ -23,7 +23,7 @@ class S3Client(AWSAPIClient):
'Bucket': bucket_name,
'Key': file_key,
# 別ファイル名に変更するための仕掛け。Unicode文字はquoteでエスケープが必要
'ResponseContentDisposition': f'attachment; filename="{quote(download_filename)}"'
'ResponseContentDisposition': f"attachment; filename*=UTF-8''{quote(download_filename)}"
},
# 有効期限20分
ExpiresIn=1200