"download_file" should be "upload_file"
per the function name. Otherwise you get an error. "werkzeug.routing.BuildError: Could not build url for endpoint 'download_file' with values ['name']. Did you mean 'upload_file' instead?"
This commit is contained in:
parent
776bf09fdf
commit
3241e9059d
1 changed files with 1 additions and 1 deletions
|
|
@ -63,7 +63,7 @@ the file and redirects the user to the URL for the uploaded file::
|
|||
if file and allowed_file(file.filename):
|
||||
filename = secure_filename(file.filename)
|
||||
file.save(os.path.join(app.config['UPLOAD_FOLDER'], filename))
|
||||
return redirect(url_for('download_file', name=filename))
|
||||
return redirect(url_for('upload_file', name=filename))
|
||||
return '''
|
||||
<!doctype html>
|
||||
<title>Upload new File</title>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue