1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-18 02:17:05 +00:00

HandleDir: add Attachments options to DirOptions

have a bit more work to do on that, if Gzip option is true then it  does not work and it's not the 'if gzip' statement inside the handler


Former-commit-id: 866578d29b6a63ee60a22b0eb9b37288c717b7e2
This commit is contained in:
Gerasimos (Makis) Maropoulos
2020-07-07 15:40:12 +03:00
parent cba6351d62
commit 645da2b2ef
4 changed files with 50 additions and 5 deletions

View File

@@ -54,8 +54,19 @@ func main() {
filesRouter := app.Party("/files")
{
filesRouter.HandleDir("/", uploadDir, iris.DirOptions{
Gzip: true,
Gzip: false,
ShowList: true,
// Optionally, force-send files to the client inside of showing to the browser.
Attachments: iris.Attachments{
Enable: true,
// Optionally, control data sent per second:
Limit: 50.0 * iris.KB,
Burst: 100 * iris.KB,
// Change the destination name through:
// NameFunc: func(systemName string) string {...}
},
DirList: iris.DirListRich(iris.DirListRichOptions{
// Optionally, use a custom template for listing:
// Tmpl: dirListRichTemplate,