Attachment

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

  1. c.Attachment(file ...string)
  1. app.Get("/", func(c *fiber.Ctx) {
  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. })