Documentation ¶
Overview ¶
Copyright 2019-2020 Axetroy. All rights reserved. MIT license.
Copyright 2019-2020 Axetroy. All rights reserved. MIT license.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var File = router.Handler(func(c router.Context) { filename := c.Param("filename") filePath := path.Join(config2.Upload.Path, config2.Upload.File.Path, filename) if !fs.PathExists(filePath) { http.NotFound(c.Writer(), c.Request()) return } c.Header("Content-Disposition", fmt.Sprintf("attachment; filename=%v", filename)) http.ServeFile(c.Writer(), c.Request(), filePath) })
View Source
var Image = router.Handler(func(c router.Context) { filename := c.Param("filename") originImagePath := path.Join(config2.Upload.Path, config2.Upload.Image.Path, filename) if !fs.PathExists(originImagePath) { http.NotFound(c.Writer(), c.Request()) return } c.Header("Content-Disposition", fmt.Sprintf("attachment; filename=%v", filename)) http.ServeFile(c.Writer(), c.Request(), originImagePath) })
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.