I have an upload button that uploads a file. It works fine.
dbc.Col(dcc.Upload(html.Button(‘Upload CTM’),
id=‘hist-upload’), width={‘size’: 2})]),
I have a callback that is triggered on the file contents and file name.
I want to have the page refresh after the upload so I tried this:
dbc.Col(html.A(dcc.Upload(html.Button(‘Upload CTM’),
id=‘hist-upload’),
href=’/history-version’), width={‘size’: 2})
However, it does not work like I want it to. It seems to immediately refresh the page, then I get the upload file selection dialog but the file is never uploaded. It appears to trigger the callback before the file selection dialog even shows up. Since I haven’t even selected a file, the file contents and filename is None.
Without the html.A around the upload the upload works as desired but the page is not refreshed.
How can I get both to happen? 1. upload the file and 2. refresh the page