Skip to content

Commit 37cbbca

Browse files
committed
response with file_name
1 parent 1775c92 commit 37cbbca

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

api/app/services/serveUploadedFiles.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ def handle_upload_image_file(thumbnail, upload_file: None, raw_data_file = None)
6161
imagePaths['thumbnail'] = os.environ.get('API_URL') + os.environ.get('IMAGE_THUMBNAIL_LOCAL_PATH') + imagePaths['thumbnail'] if imagePaths.get('thumbnail') else None
6262

6363
imagePaths['storage'] = os.environ.get('PREFERED_STORAGE')
64+
imagePaths['file_name'] = imagePaths['original'].split('/')[-1]
6465
return imagePaths
6566
else:
6667
raise HTTPException(status_code=status.HTTP_503_SERVICE_UNAVAILABLE, detail='The file format not supported')
@@ -106,6 +107,7 @@ def handle_upload_video_file(optimize, upload_file: None, raw_data_file = None):
106107
videoPaths['optimized'] = os.environ.get('API_URL') + os.environ.get('VIDEO_OPTIMIZED_LOCAL_PATH') + videoPaths['optimized'] if videoPaths.get('optimized') else None
107108

108109
videoPaths['storage'] = os.environ.get('PREFERED_STORAGE')
110+
videoPaths['file_name'] = videoPaths['original'].split('/')[-1]
109111

110112
return videoPaths
111113
else:

0 commit comments

Comments
 (0)