File uploading error
See original GitHub issueI’d like to test uploading files to API server. Using your test client, I wrote the test as below:
with (datadir / "image.png").open("rb") as fp:
files = {"image": ("sample.png", fp, "image/png")}
response = await client.post("/api/upload_image", files=files)
But multipart file handling seems to have some error. I don’t think that decoding binary data of a file into str is possible.
if isinstance(value, bytes):
> value = value.decode("ascii")
E UnicodeDecodeError: 'ascii' codec can't decode byte 0x89 in position 0: ordinal not in range(128)
../../../../../.venv/lib/python3.7/site-packages/async_asgi_testclient/multipart.py:59: UnicodeDecodeError
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Error Messages Explained - Manual - PHP
The error code can be found in the error segment of the file array that is created during the file upload by PHP....
Read more >Common uploading errors - YouTube Help - Google Support
If you're having problems uploading your video, select the error message you're seeing and follow the troubleshooting steps to solve your issue.
Read more >How to Solve File Upload Errors in Google Drive - MakeUseOf
How to Solve File Upload Errors in Google Drive: 8 Quick Solutions · 1. Check Google Drive's Status · 2. Check Your Network...
Read more >How to access error code associated with file upload in PHP
How to access error code associated with file upload in PHP ?
Read more >Problems with uploading files - IBM
When you are submitting a request through the Web Gateway to upload a file, you might receive an HTTP error code and a...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I’ll try to fix it tonight 😃
Yay! 🎉