Skip to content

Commit 2ad29ad

Browse files
committed
Fix multipart file upload for Async clients
1 parent 23d093d commit 2ad29ad

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Changelog
22

33
## [Unreleased]
4+
### Fixed
5+
- Multipart file upload for Async clients, by @HardNorth
46

57
## [5.5.0]
68
### Added

reportportal_client/core/rp_requests.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -578,6 +578,7 @@ async def payload(self) -> aiohttp.MultipartWriter:
578578
mp_writer = aiohttp.MultipartWriter('form-data')
579579
mp_writer.append_payload(json_payload)
580580
for _, file in self._get_files():
581-
file_payload = aiohttp.Payload(file[1], content_type=file[2], filename=file[0])
581+
file_payload = aiohttp.BytesPayload(file[1], content_type=file[2])
582+
file_payload.set_content_disposition('form-data', name='file', filename=file[0])
582583
mp_writer.append_payload(file_payload)
583584
return mp_writer

0 commit comments

Comments
 (0)