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:
parent
f49f4ca10d
commit
31ea2f650b
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user