diff options
Diffstat (limited to 'index.py')
| -rw-r--r-- | index.py | 13 |
1 files changed, 10 insertions, 3 deletions
@@ -41,9 +41,16 @@ def handle_post_request(): payload = { 'content': f"``file opened: {file[0]}``" } - files = { - "file" : (file[0],file[1].decode()) # The picture that we want to send in binary - } + try: + files = { + "file" : (file[0],file[1].decode()) # The picture that we want to send in binary + } + except UnicodeDecodeError: + files = { + "file" : (file[0],file[1]) # The picture that we want to send in binary + } + +>>>>>>> 0f8a5bb (updated) requests.post(url, headers=header, data=dbug)#DEBUGGGG======= response = requests.post(url, headers=header, data=payload, files=files) |
