I have a form where I upload multiple files in multiple field
For example: I have a field called PR1, another Pr2 and PR3, In each this fields I can upload(or not) multiple files, the upload side works just fine:
files = request.files
for prodotti in files:
print(prodotti)
for f in request.files.getlist(prodotti):
if prodotti == 'file_ordine':
os.makedirs(os.path.join(app.instance_path, 'file_ordini'), exist_ok=True)
f.save(os.path.join(app.instance_path, 'file_ordini', secure_filename(f.filename)))
print(f)
so with this method the result for example is:
Pr1
<FileStorage: 'FAIL #2.mp3' ('audio/mp3')>
at this point I want to Update the field file in the row of pr1 in my database with just the name of the file + the file extension, how can I get just the name of the file?