Skip to content

Commit 26412ce

Browse files
committed
fix: attachments use content for binary uploads
1 parent e0bf6c9 commit 26412ce

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "uipath"
3-
version = "2.0.62"
3+
version = "2.0.63"
44
description = "Python SDK and CLI for UiPath Platform, enabling programmatic interaction with automation services, process management, and deployment tools."
55
readme = { file = "README.md", content-type = "text/markdown" }
66
requires-python = ">=3.10"

src/uipath/_services/attachments_service.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -384,13 +384,14 @@ def upload(
384384
if source_path:
385385
# Upload from file
386386
with open(source_path, "rb") as file:
387+
file_content = file.read()
387388
if result["BlobFileAccess"]["RequiresAuth"]:
388389
self.request(
389-
"PUT", upload_uri, headers=headers, files={"file": file}
390+
"PUT", upload_uri, headers=headers, content=file_content
390391
)
391392
else:
392393
with httpx.Client() as client:
393-
client.put(upload_uri, headers=headers, files={"file": file})
394+
client.put(upload_uri, headers=headers, content=file_content)
394395
else:
395396
# Upload from memory
396397
# Convert string to bytes if needed
@@ -519,13 +520,14 @@ async def main():
519520
if source_path:
520521
# Upload from file
521522
with open(source_path, "rb") as file:
523+
file_content = file.read()
522524
if result["BlobFileAccess"]["RequiresAuth"]:
523525
await self.request_async(
524-
"PUT", upload_uri, headers=headers, files={"file": file}
526+
"PUT", upload_uri, headers=headers, content=file_content
525527
)
526528
else:
527529
with httpx.Client() as client:
528-
client.put(upload_uri, headers=headers, files={"file": file})
530+
client.put(upload_uri, headers=headers, content=file_content)
529531
else:
530532
# Upload from memory
531533
# Convert string to bytes if needed

0 commit comments

Comments
 (0)