MCPcopy Create free account
hub / github.com/devfeel/dotweb / Attachment

Method Attachment

context.go:449–451  ·  view source on GitHub ↗

Attachment sends a response as attachment, prompting client to save the file. for issue #39

(file, name string)

Source from the content-addressed store, hash-verified

447// Attachment sends a response as attachment, prompting client to save the file.
448// for issue #39
449func (ctx *HttpContext) Attachment(file, name string) (err error) {
450 return ctx.contentDisposition(file, name, "attachment")
451}
452
453// Inline sends a response as inline, opening the file in the browser.
454// if file not exists, response 404

Callers

nothing calls this directly

Calls 1

contentDispositionMethod · 0.95

Tested by

no test coverage detected