Resolve "Fuzzing Errors /api/upload"

This commit is contained in:
jfriedli 2020-05-08 09:10:18 -07:00
parent 9157dee69f
commit 853ace7d83
5 changed files with 46 additions and 5 deletions

View file

@ -65,6 +65,8 @@ def get_supported_extensions():
def save_file(file, upload_folder):
filename = secure_filename(file.filename)
if not filename:
raise ValueError('Invalid Filename')
filepath = os.path.join(upload_folder, filename)
file.save(os.path.join(filepath))
return filename, filepath