Created
May 31, 2013 16:21
-
-
Save encodes1/5686112 to your computer and use it in GitHub Desktop.
check allowed extensions flask / python returns true if in allowed list and false if not . (to find ext) and not in allowed list
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def allowed_file(filename): | |
allowed = app.config['ALLOWED_EXTENSIONS'] | |
return '.' in filename and filename.rsplit('.', 1)[1] in allowed | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment