Skip to content
Myr

Wrong variable name use

Before adoption: this commit came in with the history the project adopted, so no landing records it.

File upload section upload_file function in file request parameter variable name is "file". but file save method in secure_filename function in use "f.filename".

authored by kaushik kothiya · committed by David Lord · parent e7b16b5 · Browse files · 1 file+1 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+1 added−1 removed

  • other:+1 added−1 removed

1 file+1 added−1 removed

modified:docs/quickstart.rst+1 added-1 removed
624 unmodified lines
625 @app.route('/upload', methods=['GET', 'POST'])626 def upload_file():627 if request.method == 'POST':628 file = request.files['the_file']629 file.save(f"/var/www/uploads/{secure_filename(f.filename)}")629 file.save(f"/var/www/uploads/{secure_filename(file.filename)}")630 ...631632For some better examples, see :doc:`patterns/fileuploads`.633
305 unmodified lines