1
0
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:
Thomas Miceli 2023-03-23 16:27:38 +01:00
parent 6c981570a1
commit c1ad78d984
No known key found for this signature in database
GPG Key ID: D86C6F6390AF050F

@ -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)
}