Hello, I am trying to upload some .wav files by using FileInput widget, after get the files I wish to get the name/and change the filename, then save/ download the documents.
for now:
- I can’t get the name of the file
- I didn’t find a way to save the file
Here is my short example:
#this is a simplified code from what I am trying to do
from bokeh.models import FileInput
#a list to store original file name
list1 = []
#a list to store changed file name
list2 = []
#here: allow only wav files
file_input1 = FileInput(accept=".wav")
#to get the name of the file
def upload_data1(attr, old, new):
#get the name of the file
list1.append(file_input1.filename) #I tried but can't get the name
print(list1)
file_input1.on_change('value',upload_data1)
thank you very much.