Trigger link via callback


I have a need to trigger a download (via a presigned-url from AWS S3) in dash. I have this working using two steps and buttons, a simple button with associated callback to upload a file to S3 and generate the URL which then updates the href component of an html link button nested within a modal. This works well but ideally I would do away with the second step and trigger the download in the background. Any thoughts on achieving this would be appreciated.

All the best

Did you try the Download component?

Hi Emil, thanks for the suggestion. I’ve used that before, in my use case it won’t work for me because the app uses API gateway which limits requests to 10MB. An href to a presigned-url doesn’t seem to be limited in this way whereas the download component does. There may be security reasons why a link cannot be triggered in a callback, I’ve tried incrementing the n_clicks but it doesn’t have the desired effect (triggering the download) whereas an actual click event does.