Using an endpoint to initialize Dash app

Ah OK - that’s a lot simpler than I thought you were saying :slight_smile: Then I think you can:

  • add an @app.server.route - similar to what what’s described in Allowing users to download CSV on click - but that accepts the file in some convenient format and stores it somewhere on the server (being careful about making it accessible to multiple processes if you’re expecting to run the app that way) - this is where the other services would post their file.
  • give the upload-filecallback another input - perhaps connected to a button that says “use latest saved file”, or perhaps even better connected to the page URL via dcc.Location, if you want users to be able to go directly to this state, and then you can have a dcc.Link next to the dcc.Upload, that points to this URL.
  • If the button or location is what triggered the callback (ie there’s no file data, or if dash.callback_context.triggered lists the button/location) then you load the saved file; otherwise you use the uploaded file.
  • If it’s not just the last file you’re interested in, you could even look up a whole list of saved files on the server, and put these into a dropdown (or a list of dcc.Link elements if you think it would be useful to have a separate URL for each file) and use that as an additional input to this callback.