From 4766a0a386f942ea8b5248463a88699a05b606c4 Mon Sep 17 00:00:00 2001 From: Konotorii <79553360+konotorii@users.noreply.github.com> Date: Thu, 20 Jun 2024 12:41:26 -0400 Subject: [PATCH] fix: Screenshot folder and return link (AGAIN) --- main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index 8090462..dda0356 100644 --- a/main.go +++ b/main.go @@ -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) }