Attachment

Sets the HTTP response Content-Disposition header field to attachment.

  1. func (c *Ctx) Attachment(filename ...string)
  1. app.Get("/", func(c *fiber.Ctx) error {
  2. c.Attachment()
  3. // => Content-Disposition: attachment
  4. c.Attachment("./upload/images/logo.png")
  5. // => Content-Disposition: attachment; filename="logo.png"
  6. // => Content-Type: image/png
  7. // ...
  8. })