Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -78,7 +78,6 @@ def upload_file():
|
|
| 78 |
try:
|
| 79 |
if request.method == 'POST':
|
| 80 |
if 'file' not in request.files:
|
| 81 |
-
print("the file 1 ",file)
|
| 82 |
flash('No file part', 'error')
|
| 83 |
return render_template('upload.html') # Avoid redirect loop
|
| 84 |
|
|
@@ -89,13 +88,12 @@ def upload_file():
|
|
| 89 |
|
| 90 |
if file and allowed_file(file.filename):
|
| 91 |
filename = secure_filename(file.filename)
|
| 92 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 93 |
file_path = os.path.join(app.config['UPLOAD_FOLDER'], filename)
|
| 94 |
-
print("the file path ",file_path)
|
| 95 |
-
print("Current user:", os.getuid())
|
| 96 |
-
print("Upload folder permissions:", os.stat(app.config['UPLOAD_FOLDER']).st_mode)
|
| 97 |
-
print("Trying to save file:", file_path)
|
| 98 |
-
session['uploaded_PDF'] = file_path
|
| 99 |
file.save(file_path)
|
| 100 |
print("file save in folder")
|
| 101 |
|
|
|
|
| 78 |
try:
|
| 79 |
if request.method == 'POST':
|
| 80 |
if 'file' not in request.files:
|
|
|
|
| 81 |
flash('No file part', 'error')
|
| 82 |
return render_template('upload.html') # Avoid redirect loop
|
| 83 |
|
|
|
|
| 88 |
|
| 89 |
if file and allowed_file(file.filename):
|
| 90 |
filename = secure_filename(file.filename)
|
| 91 |
+
file_path = os.path.join(app.config['UPLOAD_FOLDER'])
|
| 92 |
+
if file_path:
|
| 93 |
+
print("Folder got it")
|
| 94 |
+
else:
|
| 95 |
+
print("Folder not got it......................")
|
| 96 |
file_path = os.path.join(app.config['UPLOAD_FOLDER'], filename)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 97 |
file.save(file_path)
|
| 98 |
print("file save in folder")
|
| 99 |
|