Skip to content

Commit

Permalink
filename added
Browse files Browse the repository at this point in the history
  • Loading branch information
ritikasharma-brooklyn committed Aug 23, 2024
1 parent ba68c8b commit 877f04c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions willisapi_client/services/upload/upload_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,7 @@ def upload(index, row, url, headers, force_upload) -> Tuple[bool, str]:
(upload_id, record_id, error) = UploadUtils.initiate_multi_part_upload(
index, row, url, headers, force_upload
)
filename = os.path.basename(row.file_path)
uploaded = False
if upload_id and record_id:
presigned_urls, number_of_parts = UploadUtils.fetch_pre_signed_part_urls(
Expand All @@ -314,7 +315,7 @@ def upload(index, row, url, headers, force_upload) -> Tuple[bool, str]:
if len(presigned_urls) != number_of_parts:
parts = json.dumps([])
res = requests.post(
f"{url}?type=complete&record_id={record_id}&upload_id={upload_id}&number_of_parts={number_of_parts}",
f"{url}?type=complete&record_id={record_id}&upload_id={upload_id}&number_of_parts={number_of_parts}&filename={filename}",
json=parts,
headers=headers,
)
Expand All @@ -324,7 +325,7 @@ def upload(index, row, url, headers, force_upload) -> Tuple[bool, str]:
UploadUtils.close_file(file)
parts = json.dumps(parts)
res = requests.post(
f"{url}?type=complete&record_id={record_id}&upload_id={upload_id}&number_of_parts={number_of_parts}",
f"{url}?type=complete&record_id={record_id}&upload_id={upload_id}&number_of_parts={number_of_parts}&filename={filename}",
json=parts,
headers=headers,
)
Expand Down

0 comments on commit 877f04c

Please sign in to comment.