Black Lives Matter. Please consider donating to Black Girls Code today.

Dash data table download

Hello Team,

I am currently using the below script to download the data table from the dash which i created. The download is working fine however when i hosted the Dash and when i try to click the download button through another system, the file is being downloaded at the host computer and not at user computer. I apologize if my question seems silly as i am very new to Dash & python.

html.Button(id=“save-button”,n_clicks=0,children=“Save”),
html.Div(id=“output-1”,children=“Press button to save data at your desktop”)

@app.callback(
Output(“output-1”,“children”),
[Input(“save-button”,“n_clicks”)],
[State(“table”,“data”)])

def selected_data_to_csv(nclicks,table1):
if nclicks == 0:
raise PreventUpdate
else:

pd.DataFrame(table1).to_csv(‘C:\Users\’+loggedin_user+’\Desktop\Open_Queue_Dump.csv’,index=False)
return “Data Submitted”

Kindly assist.