Skip to content

Commit

Permalink
Merge pull request #226 from praw-dev/fix_image_upload
Browse files Browse the repository at this point in the history
Fix uploading files for submit
  • Loading branch information
LilSpazJoekp committed Dec 21, 2022
2 parents e3fef84 + 8ecdd01 commit f2536b2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGES.rst
Expand Up @@ -14,6 +14,7 @@ Unreleased
**Fixed**

- An issue with iterating :class:`.ModNote` when a user has more than a hundred notes.
- An issue when uploading media to submit.

7.6.1 (2022/11/28)
------------------
Expand Down
3 changes: 2 additions & 1 deletion asyncpraw/models/reddit/subreddit.py
Expand Up @@ -702,8 +702,9 @@ async def _submit_media(

async def _read_and_post_media(self, media_path, upload_url, upload_data):
with open(media_path, "rb") as media:
upload_data["file"] = media
response = await self._reddit._core._requestor._http.post(
upload_url, data=upload_data, files={"file": media}
upload_url, data=upload_data
)
return response

Expand Down

0 comments on commit f2536b2

Please sign in to comment.