Streaming file download

Hi there,

I would like to use the FileDownloader widget with a callback but instead of returning an entire file-like object, I would to return a generator over byte chunks such that the output is streamed. Is this already somehow possible?

This is important to me because I want to stream large data from another location through the Panel app without storing everything locally in memory. If it’s not possible, I guess, I have to embed Panel inside FastAPI or so and provide an endpoint there.

1 Like

Hi @Midnighter

I think the way to achieve this would be a custom component. The post Working file input with progress update - Panel - HoloViz Discourse might provide inspiration.

@philippjfr migh have additional ideas on how to achieve this?

1 Like

Thank you for the pointer. That seems like it might be a solution. In the meantime, I’ve embedded Panel inside a FastAPI app and call an endpoint to stream down the files.

1 Like