Attachment sends a response as attachment, prompting client to save the file. Avoid using the leading `/` slash as most of the Go standard library fs.FS implementations require relative paths for file operations.
(file, name string)
| 704 | // Avoid using the leading `/` slash as most of the Go standard library fs.FS implementations require relative paths for |
| 705 | // file operations. |
| 706 | func (c *Context) Attachment(file, name string) error { |
| 707 | return c.contentDisposition(file, name, "attachment") |
| 708 | } |
| 709 | |
| 710 | // Inline sends a response as inline, opening the file in the browser. |
| 711 | // |