mirror of
https://github.com/thomiceli/opengist
synced 2024-11-08 12:55:50 +01:00
Add file header for zipped files
This commit is contained in:
parent
6c981570a1
commit
c1ad78d984
@ -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 New Issue
Block a user