mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-07 14:50:55 +03:00
download as zip: improve filename
include username and also filename/directory name if the user downloads a single file/directory Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
@@ -390,7 +390,8 @@ func getUserFilesAsZipStream(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
filesList = util.RemoveDuplicates(filesList, false)
|
||||
|
||||
w.Header().Set("Content-Disposition", "attachment; filename=\"sftpgo-download.zip\"")
|
||||
w.Header().Set("Content-Disposition", fmt.Sprintf("attachment; filename=\"%s\"",
|
||||
getCompressedFileName(connection.GetUsername(), filesList)))
|
||||
renderCompressedFiles(w, connection, baseDir, filesList, nil)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user