mirror of
https://github.com/arc53/DocsGPT.git
synced 2026-02-10 16:21:01 +00:00
(fix:attachment) strictly use filename
This commit is contained in:
@@ -2978,7 +2978,7 @@ class StoreAttachment(Resource):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
attachment_id = ObjectId()
|
attachment_id = ObjectId()
|
||||||
original_filename = secure_filename(file.filename)
|
original_filename = secure_filename(os.path.basename(file.filename))
|
||||||
relative_path = f"{settings.UPLOAD_FOLDER}/{user}/attachments/{str(attachment_id)}/{original_filename}"
|
relative_path = f"{settings.UPLOAD_FOLDER}/{user}/attachments/{str(attachment_id)}/{original_filename}"
|
||||||
|
|
||||||
metadata = storage.save_file(file, relative_path)
|
metadata = storage.save_file(file, relative_path)
|
||||||
|
|||||||
Reference in New Issue
Block a user