mirror of
https://github.com/thomiceli/opengist.git
synced 2024-12-23 13:02:39 +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)
|
zipWriter := zip.NewWriter(zipFile)
|
||||||
|
|
||||||
for _, file := range files {
|
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 {
|
if err != nil {
|
||||||
return errorRes(500, "Error adding a file the to the zip archive", err)
|
return errorRes(500, "Error adding a file the to the zip archive", err)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue