Skip to content

Commit

Permalink
fix: Screenshot folder and return link (AGAIN)
Browse files Browse the repository at this point in the history
  • Loading branch information
konotorii committed Jun 20, 2024
1 parent e9b97d7 commit 4766a0a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,13 @@ func postImage(c *gin.Context) {
consola.Log(file.Filename)

// Upload the file to specific dst.
err := c.SaveUploadedFile(file, "/public/screenshots")
err := c.SaveUploadedFile(file, "./public/screenshots/"+file.Filename)
if err != nil {
consola.Error(err)
c.Status(500)
}

c.JSON(200, gin.H{"url": fmt.Sprintf("https://img.kono.services/img?path=screenshots/%p", file.Filename)})
c.JSON(200, gin.H{"url": fmt.Sprintf("https://img.kono.services/img?path=screenshots/" + file.Filename)})
} else {
c.Status(400)
}
Expand Down

0 comments on commit 4766a0a

Please sign in to comment.