mirror of
https://github.com/filebrowser/filebrowser.git
synced 2024-06-07 23:00:43 +00:00
fix bug, download on root
This commit is contained in:
parent
23115e50db
commit
72e65e85fb
@ -77,7 +77,12 @@ func Download(w http.ResponseWriter, r *http.Request, c *config.Config, i *file.
|
|||||||
return http.StatusInternalServerError, err
|
return http.StatusInternalServerError, err
|
||||||
}
|
}
|
||||||
|
|
||||||
w.Header().Set("Content-Disposition", "attachment; filename="+i.Name()+extension)
|
name := i.Name()
|
||||||
|
if name == "" {
|
||||||
|
name = "download"
|
||||||
|
}
|
||||||
|
|
||||||
|
w.Header().Set("Content-Disposition", "attachment; filename="+name+extension)
|
||||||
io.Copy(w, file)
|
io.Copy(w, file)
|
||||||
return http.StatusOK, nil
|
return http.StatusOK, nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user