mirror of
https://github.com/aljazceru/CTFd.git
synced 2025-12-17 14:04:20 +01:00
Fix S3 file downloads to not contain the folder name (#1056)
* Fixes a bug in S3 downloads where a downloaded file would have its parent folder name in the filename
This commit is contained in:
@@ -110,11 +110,13 @@ class S3Uploader(BaseUploader):
|
||||
return dst
|
||||
|
||||
def download(self, filename):
|
||||
key = filename
|
||||
filename = filename.split('/').pop()
|
||||
url = self.s3.generate_presigned_url(
|
||||
"get_object",
|
||||
Params={
|
||||
"Bucket": self.bucket,
|
||||
"Key": filename,
|
||||
"Key": key,
|
||||
"ResponseContentDisposition": "attachment; filename={}".format(
|
||||
filename
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user