Skip to content

Serving files #4826

@willmcgugan

Description

@willmcgugan

We need a method to expose a file from a Textual app which save it locally, or downloads it when running as a web application.

Locally the file would be copied to a pre-determined directory. Probably ~/Downloads or whatever makes sense on the OS.

As a web application, the browser would treat it as a download.

The API would be something like this (on App):

def save_file(self, path_or_filelilke, mime_type:str, download:bool) -> None:
    ...

TBD

  • Should we separate opening a file from downloading?
  • How do we configure where the file saves locally?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions