Spaces:
Runtime error
Runtime error
taslim19 commited on
Commit ·
ee83604
1
Parent(s): 3cd2f05
added upload.py
Browse files
Devine/plugins/Dev/upload.py
CHANGED
|
@@ -29,15 +29,13 @@ async def upload_file(client, message, file_path):
|
|
| 29 |
|
| 30 |
with open(file_path, 'rb') as file:
|
| 31 |
files = {
|
| 32 |
-
"file": file
|
| 33 |
-
}
|
| 34 |
-
data = {
|
| 35 |
"api_key": API_KEY,
|
| 36 |
"timestamp": int(time.time()),
|
| 37 |
-
"signature": API_SECRET
|
| 38 |
}
|
| 39 |
-
response = requests.post(CLOUDINARY_UPLOAD_URL,
|
| 40 |
-
|
| 41 |
upload_time = round(time.time() - start_time, 2)
|
| 42 |
|
| 43 |
if response.status_code == 200:
|
|
|
|
| 29 |
|
| 30 |
with open(file_path, 'rb') as file:
|
| 31 |
files = {
|
| 32 |
+
"file": file,
|
|
|
|
|
|
|
| 33 |
"api_key": API_KEY,
|
| 34 |
"timestamp": int(time.time()),
|
| 35 |
+
"signature": API_SECRET
|
| 36 |
}
|
| 37 |
+
response = requests.post(CLOUDINARY_UPLOAD_URL, data=files)
|
| 38 |
+
|
| 39 |
upload_time = round(time.time() - start_time, 2)
|
| 40 |
|
| 41 |
if response.status_code == 200:
|