forked from orbit-oss/flask
Update allowed_file function in fileuploads.rst
Update allowed_file function to accept lowercase and uppercase file extensions
This commit is contained in:
parent
495d834b99
commit
fe53da45c5
1 changed files with 1 additions and 1 deletions
|
|
@ -47,7 +47,7 @@ the file and redirects the user to the URL for the uploaded file::
|
||||||
|
|
||||||
def allowed_file(filename):
|
def allowed_file(filename):
|
||||||
return '.' in filename and \
|
return '.' in filename and \
|
||||||
filename.rsplit('.', 1)[1] in ALLOWED_EXTENSIONS
|
filename.rsplit('.', 1)[1].lower() in ALLOWED_EXTENSIONS
|
||||||
|
|
||||||
@app.route('/', methods=['GET', 'POST'])
|
@app.route('/', methods=['GET', 'POST'])
|
||||||
def upload_file():
|
def upload_file():
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue