add hash to download filename

This commit is contained in:
Michael Zhang 2020-10-14 16:51:36 -05:00
parent c7271d2d33
commit ff9e17b11e
Signed by: michael
GPG key ID: BDA47A31A3C8EE6B

View file

@ -94,7 +94,7 @@ func (web *Web) mapZip(c *gin.Context) {
files := tree.Files()
c.Writer.Header().Set("Content-type", "application/octet-stream")
c.Writer.Header().Set("Content-Disposition", fmt.Sprintf("attachment; filename=%s.zip", mapId))
c.Writer.Header().Set("Content-Disposition", fmt.Sprintf("attachment; filename=%s-%s.zip", mapId, hash))
c.Stream(func(w io.Writer) bool {
ar := zip.NewWriter(w)
for {