...
This commit is contained in:
parent
259a3ad713
commit
597840d132
33
Flask/app.py
33
Flask/app.py
|
@ -420,22 +420,23 @@ def allowed_file(filename):
|
||||||
@app.route('/upload_file/', methods=['POST', "GET"])
|
@app.route('/upload_file/', methods=['POST', "GET"])
|
||||||
@login_required
|
@login_required
|
||||||
def upload_file():
|
def upload_file():
|
||||||
print(request.files)
|
if request.method == 'POST':
|
||||||
print(request)
|
print(request.files)
|
||||||
# check if the post request has the file part
|
print(request)
|
||||||
if 'file' not in request.files:
|
# check if the post request has the file part
|
||||||
print('No file part')
|
if 'file' not in request.files:
|
||||||
#return redirect(url_for('settings_get'))
|
print('No file part')
|
||||||
file = request.files['file']
|
#return redirect(url_for('settings_get'))
|
||||||
# If the user does not select a file, the browser submits an
|
file = request.files['file']
|
||||||
# empty file without a filename.
|
# If the user does not select a file, the browser submits an
|
||||||
if file.filename == '':
|
# empty file without a filename.
|
||||||
print('No selected file')
|
if file.filename == '':
|
||||||
#return redirect(url_for('settings_get'))
|
print('No selected file')
|
||||||
if file and allowed_file(file.filename):
|
#return redirect(url_for('settings_get'))
|
||||||
filename = secure_filename(file.filename)
|
if file and allowed_file(file.filename):
|
||||||
file.save(os.path.join('/app/MsRewards-Reborn/user_data/', filename))
|
filename = secure_filename(file.filename)
|
||||||
#return redirect(url_for('settings_get'))
|
file.save(os.path.join('/app/MsRewards-Reborn/user_data/', filename))
|
||||||
|
#return redirect(url_for('settings_get'))
|
||||||
return '''
|
return '''
|
||||||
<!doctype html>
|
<!doctype html>
|
||||||
<title>Upload new File</title>
|
<title>Upload new File</title>
|
||||||
|
|
Loading…
Reference in New Issue