☰Read-only archive⌕
Looking for help with Bokeh?

This is a read-only archive. Ask questions and join the conversation on GitHub.

Visit Community Support on GitHub →
Archived discussions · Captured October 28, 2026

Getting filename and value from FileInput in the same time

Community Support
angels_demos
angels_demos

Hi all!
I have a bokeh app using FileInput. However when i tried to get filename and value cannot getting the filename because of the problem i mentioned below.

Basic code:

fn=[]

def get_filename(attr, old, new):
    global fn
    fn.append(new)
    print(new + " is selected")

def upload_file(attr, old, new):
    # some codes
    print("--------")
    print(fn)

file_input = FileInput(name="fileinput", accept=".csv")
file_input.on_change('filename', get_filename)
file_input.on_change('value', upload_file)

and it returns:

[]
filename.csv is selected

It’s because upload_file function start first somehow. It shouldn’t be. Do you know guys the reason or any method to get filename and value from FileInput in the same time? I tried couple of things but everytime upload_file function is the first one to start, so i cannot getting the filename in that function.

⌁   Link to post
Bryan
Bryan

A combined event is still an open issue:

For now you can simply have one callback for value that also accesses the filename (since it will be set by that point).

⌁   Link to post

End of archived discussion · Replies are disabled