Skip to content

Instantly share code, notes, and snippets.

@encodes1
Created May 31, 2013 16:21
Show Gist options
  • Save encodes1/5686112 to your computer and use it in GitHub Desktop.
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
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