better api

This commit is contained in:
2025-08-17 01:08:22 +02:00
parent 882a6e2c14
commit bbbb760afd
8 changed files with 38 additions and 39 deletions

View File

@@ -5,8 +5,9 @@ import (
"os"
"path/filepath"
"github.com/gin-gonic/gin"
"fitra-backend/utils"
"github.com/gin-gonic/gin"
)
func HandleFileDownload(c *gin.Context) {
@@ -25,7 +26,7 @@ func HandleFileDownload(c *gin.Context) {
}
// Send analytics event
utils.SendAnalyticsEvent("file_download", "/api/download/"+fileID+"/"+filename, "File Download", c.GetHeader("User-Agent"), c.ClientIP())
utils.SendAnalyticsEvent("pageview", "/api/download/"+fileID+"/"+filename)
c.Header("Content-Description", "File Transfer")
c.Header("Content-Transfer-Encoding", "binary")