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.  
  5. c.Attachment("./upload/images/logo.png")
  6. // => Content-Disposition: attachment; filename="logo.png"
  7. // => Content-Type: image/png
  8. })