I would like to use the download component to point at a file that is in an AWS S3 bucket. Below is essentially what I am attempting but am getting:
OSError: [Errno 22] Invalid argument: 'https://bucketname.s3.us-east-2.amazonaws.com/download/123456.csv'
Is it possible to do this? I have changed the actual bucket name in both the code and error… thank you
from dash import Dash, dcc, html, Input, Output app = Dash(__name__) app.layout = html.Div([ html.Button("Download Image", id="btn_image"), dcc.Download(id="download-image") ]) @app.callback( Output("download-image", "data"), Input("btn_image", "n_clicks"), prevent_initial_call=True, ) def func(n_clicks): return dcc.send_file( 'https://bucketname.s3.us-east-2.amazonaws.com/download/123456.csv' ) if __name__ == "__main__": app.run_server(debug=True)