1
0
mirror of https://github.com/thomiceli/opengist synced 2024-11-08 12:55:50 +01:00

Fix naming file on edit

This commit is contained in:
Thomas Miceli 2023-03-20 13:49:28 +01:00
parent f49f4ca10d
commit 31ea2f650b
No known key found for this signature in database
GPG Key ID: D86C6F6390AF050F

@ -209,12 +209,14 @@ func processCreate(ctx echo.Context) error {
}
dto.Files = make([]models.FileDTO, 0)
fileCounter := 0
for i := 0; i < len(ctx.Request().PostForm["content"]); i++ {
name := ctx.Request().PostForm["name"][i]
content := ctx.Request().PostForm["content"][i]
if name == "" {
name = "gistfile" + strconv.Itoa(i+1) + ".txt"
fileCounter += 1
name = "gistfile" + strconv.Itoa(fileCounter) + ".txt"
}
escapedValue, err := url.QueryUnescape(content)