Fix a possible issue wrt. inexistant upload folder

This commit is contained in:
jvoisin 2018-12-24 14:12:40 +01:00
parent 964d3683b5
commit 81ac5c3721

View File

@ -36,6 +36,9 @@ def download_file(filename:str):
@app.route('/', methods=['GET', 'POST'])
def upload_file():
if not os.path.exists(app.config['UPLOAD_FOLDER']):
os.mkdir(app.config['UPLOAD_FOLDER'])
mimetypes = set()
for parser in parser_factory._get_parsers():
mimetypes = mimetypes | parser.mimetypes