(Best) method to offer a file for download from the UI?

I am creating a CSV file in /config/csv/FILE.csv (HAOS).

How can I offer that file for downloading through a link in the UI?

If needed, I can change the location of the file.

If it not yet exists create a folder www in /config/ and in there a folder csv
Put the file in this folder.
Call it by using a link like http://your_IP:8123/local/csv/FILE.csv maybe as a button

type: custom:button-card
name: CSV File
tap_action:
  action: url
  url_path: http://your_ip:8123/local/csv/FILE.csv

Not sure if its the best way…

1 Like

@Joerg That works! I tried to make it a symbolic link to the file, but that did not work. It has to be the actual file, but I can create it in the www directory.

Yepp, guess the browser doesn’t know how to handle the link. Glad it works.

It isn’t due to the browser (the link is made on home assistant), but I see to possible reasons for failure: the webserver is protected against links outside the root directory, or, (as this is HAOS,) the web server container only gets what is inside the www directory due to volume mounting.