Secure file names also for generic image file creation

This commit is contained in:
Daniel Markstedt 2021-09-20 18:35:47 -07:00
parent 9a7989437d
commit c77e1b18ce

View File

@ -510,6 +510,9 @@ def create_file():
size = (int(request.form.get("size")) * 1024 * 1024)
file_type = request.form.get("type")
from werkzeug.utils import secure_filename
file_name = secure_filename(file_name)
process = create_new_image(file_name, file_type, size)
if process["status"] == True:
flash(f"Drive image created as {file_name}.{file_type}")