Update app.py
Browse files
app.py
CHANGED
|
@@ -28,14 +28,15 @@ if not os.path.exists(UPLOAD_FOLDER):
|
|
| 28 |
|
| 29 |
@app.route('/upload', methods=['POST'])
|
| 30 |
def upload_file():
|
| 31 |
-
if '
|
| 32 |
return "No file part", 400
|
| 33 |
-
file = request.files['
|
| 34 |
if file.filename == '':
|
| 35 |
return "No selected file", 400
|
| 36 |
-
file.save(os.path.join(UPLOAD_FOLDER,
|
| 37 |
return "File uploaded successfully", 200
|
| 38 |
|
|
|
|
| 39 |
@app.route('/image')
|
| 40 |
def get_image():
|
| 41 |
return send_from_directory(UPLOAD_FOLDER, IMAGE_FILENAME)
|
|
|
|
| 28 |
|
| 29 |
@app.route('/upload', methods=['POST'])
|
| 30 |
def upload_file():
|
| 31 |
+
if 'photo' not in request.files:
|
| 32 |
return "No file part", 400
|
| 33 |
+
file = request.files['photo']
|
| 34 |
if file.filename == '':
|
| 35 |
return "No selected file", 400
|
| 36 |
+
file.save(os.path.join(UPLOAD_FOLDER, file.filename))
|
| 37 |
return "File uploaded successfully", 200
|
| 38 |
|
| 39 |
+
|
| 40 |
@app.route('/image')
|
| 41 |
def get_image():
|
| 42 |
return send_from_directory(UPLOAD_FOLDER, IMAGE_FILENAME)
|