mirror of
https://github.com/thomiceli/opengist.git
synced 2024-12-23 04:52:40 +00:00
Add file header for zipped files
This commit is contained in:
parent
6c981570a1
commit
c1ad78d984
1 changed files with 5 additions and 1 deletions
|
@ -465,7 +465,11 @@ func downloadZip(ctx echo.Context) error {
|
|||
zipWriter := zip.NewWriter(zipFile)
|
||||
|
||||
for _, file := range files {
|
||||
f, err := zipWriter.Create(file.Filename)
|
||||
fh := &zip.FileHeader{
|
||||
Name: file.Filename,
|
||||
Method: zip.Deflate,
|
||||
}
|
||||
f, err := zipWriter.CreateHeader(fh)
|
||||
if err != nil {
|
||||
return errorRes(500, "Error adding a file the to the zip archive", err)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue