Skip to content

Commit d59dbfb

Browse files
committed
more
1 parent 38c9910 commit d59dbfb

File tree

1 file changed

+6
-2
lines changed
  • services/storage/src/simcore_service_storage/api/rest

1 file changed

+6
-2
lines changed

services/storage/src/simcore_service_storage/api/rest/_files.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,6 @@ async def upload_file(
153153
file_id: StorageFileID,
154154
request: Request,
155155
):
156-
file_id = urllib.parse.unquote(f"{file_id}")
157156
"""creates upload file links:
158157
159158
This function covers v1 and v2 versions of the handler.
@@ -182,7 +181,7 @@ async def upload_file(
182181
Use-case v2.2: if query.file_size > 0 and query.link_type=presigned or None, returns 1 or more presigned links depending on the file size (limited to a single 5TB file)
183182
Use-case v2.3: if query.link_type=s3 and query.file_size>=0, returns a single s3 direct link (limited to a single 5TB file)
184183
"""
185-
184+
file_id = urllib.parse.unquote(f"{file_id}")
186185
dsm = get_dsm_provider(request.app).get(location_id)
187186
links: UploadLinks = await dsm.create_file_upload_links(
188187
user_id=query_params.user_id,
@@ -237,6 +236,7 @@ async def abort_upload_file(
237236
file_id: StorageFileID,
238237
request: Request,
239238
):
239+
file_id = urllib.parse.unquote(f"{file_id}")
240240
dsm = get_dsm_provider(request.app).get(location_id)
241241
await dsm.abort_file_upload(query_params.user_id, file_id)
242242

@@ -252,6 +252,7 @@ async def complete_upload_file(
252252
body: Annotated[FileUploadCompletionBody, Depends()],
253253
request: Request,
254254
):
255+
file_id = urllib.parse.unquote(f"{file_id}")
255256
dsm = get_dsm_provider(request.app).get(location_id)
256257
# NOTE: completing a multipart upload on AWS can take up to several minutes
257258
# therefore we wait a bit to see if it completes fast and return a 204
@@ -299,6 +300,7 @@ async def is_completed_upload_file(
299300
# therefore we wait a bit to see if it completes fast and return a 204
300301
# if it returns slow we return a 202 - Accepted, the client will have to check later
301302
# for completeness
303+
file_id = urllib.parse.unquote(f"{file_id}")
302304
task_name = create_upload_completion_task_name(query_params.user_id, file_id)
303305
assert task_name == future_id # nosec
304306
# first check if the task is in the app
@@ -341,6 +343,7 @@ async def delete_file(
341343
file_id: StorageFileID,
342344
request: Request,
343345
):
346+
file_id = urllib.parse.unquote(f"{file_id}")
344347
dsm = get_dsm_provider(request.app).get(location_id)
345348
await dsm.delete_file(query_params.user_id, file_id)
346349

@@ -352,6 +355,7 @@ async def copy_as_soft_link(
352355
body: Annotated[SoftCopyBody, Depends()],
353356
request: Request,
354357
):
358+
file_id = urllib.parse.unquote(f"{file_id}")
355359
dsm = cast(
356360
SimcoreS3DataManager,
357361
get_dsm_provider(request.app).get(SimcoreS3DataManager.get_location_id()),

0 commit comments

Comments
 (0)