MCPcopy Index your code
hub / github.com/labstack/echo / Attachment

Method Attachment

context.go:706–708  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

704// Avoid using the leading `/` slash as most of the Go standard library fs.FS implementations require relative paths for
705// file operations.
706func (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//

Callers 1

TestContextAttachmentFunction · 0.95

Calls 1

contentDispositionMethod · 0.95

Tested by 1

TestContextAttachmentFunction · 0.76