Downloads

Downloads

Downloads allow to serve a single Resource with a fixed name to your clients. The content type of the file will automatically be determined by it's extension.

var resource = Resource.FromFile("/var/www/documents/agb.pdf");

layout.Add("agb.pdf", Download.From(resource))

In this example, the file would be available at http://localhost:8080/agb.pdf.