From: Olivier Tétard Date: Fri, 13 Nov 2015 09:59:49 +0000 (+0100) Subject: On autorise uniquement les fichiers OGG et MP3 X-Git-Url: http://olivier.miskin.fr/git/?a=commitdiff_plain;h=1d7b8a5e65fd357ef8247e0cb9b1891357d1bdba;p=femtoblackweb.git On autorise uniquement les fichiers OGG et MP3 --- diff --git a/femtoblackweb.py b/femtoblackweb.py index e185881..c581705 100644 --- a/femtoblackweb.py +++ b/femtoblackweb.py @@ -43,9 +43,9 @@ def index(): @app.route('/upload', methods=['GET', 'POST']) def upload_file(): - + def allowed_file(filename): - ALLOWED_EXTENSIONS = ['mp3', 'ogg', 'flac'] + ALLOWED_EXTENSIONS = ['mp3', 'ogg'] return '.' in filename and filename.rsplit('.', 1)[1] in ALLOWED_EXTENSIONS if request.method == 'POST':