Spaces:
Sleeping
Sleeping
Neurolingua
commited on
Commit
•
72b4474
1
Parent(s):
c2c2da0
Update app.py
Browse files
app.py
CHANGED
@@ -6,7 +6,7 @@ import requests
|
|
6 |
from PIL import Image
|
7 |
import io
|
8 |
import uuid
|
9 |
-
|
10 |
app = Flask(__name__)
|
11 |
UPLOAD_FOLDER = 'uploads'
|
12 |
if not os.path.exists(UPLOAD_FOLDER):
|
@@ -62,6 +62,8 @@ def whatsapp_webhook():
|
|
62 |
# Generate a unique filename
|
63 |
filename = f"{uuid.uuid4()}.jpg"
|
64 |
filepath = os.path.join(UPLOAD_FOLDER, filename)
|
|
|
|
|
65 |
try:
|
66 |
|
67 |
|
|
|
6 |
from PIL import Image
|
7 |
import io
|
8 |
import uuid
|
9 |
+
import shutil
|
10 |
app = Flask(__name__)
|
11 |
UPLOAD_FOLDER = 'uploads'
|
12 |
if not os.path.exists(UPLOAD_FOLDER):
|
|
|
62 |
# Generate a unique filename
|
63 |
filename = f"{uuid.uuid4()}.jpg"
|
64 |
filepath = os.path.join(UPLOAD_FOLDER, filename)
|
65 |
+
with open(filepath, 'wb') as out_file:
|
66 |
+
shutil.copyfileobj(r.raw, out_file)
|
67 |
try:
|
68 |
|
69 |
|