summaryrefslogtreecommitdiff
path: root/index.py
diff options
context:
space:
mode:
Diffstat (limited to 'index.py')
-rw-r--r--index.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/index.py b/index.py
index 52be8c7..8cf5bde 100644
--- a/index.py
+++ b/index.py
@@ -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)