Finished file name tracking

This commit is contained in:
2025-08-17 01:27:09 +02:00
parent bbbb760afd
commit 08a0e7b35d
7 changed files with 15 additions and 2 deletions

View File

@@ -1,6 +1,7 @@
package controllers
import (
"fmt"
"net/http"
"os"
"path/filepath"
@@ -26,7 +27,8 @@ func HandleFileDownload(c *gin.Context) {
}
// Send analytics event
utils.SendAnalyticsEvent("pageview", "/api/download/"+fileID+"/"+filename)
properties := fmt.Sprintf(`{"filename": "%s"}`, filename)
_ = utils.SendCustomEvent("file_download", "/api/download/"+fileID+"/"+filename, properties)
c.Header("Content-Description", "File Transfer")
c.Header("Content-Transfer-Encoding", "binary")

View File

@@ -3,6 +3,7 @@ package controllers
import (
"crypto/rand"
"encoding/hex"
"fmt"
"io"
"net/http"
"os"
@@ -102,7 +103,8 @@ func HandleFileUpload(c *gin.Context) {
}
// Send analytics event
utils.SendAnalyticsEvent("pageview", "/api/upload")
properties := fmt.Sprintf(`{"filename": "%s", "size": %d}`, header.Filename, header.Size)
utils.SendCustomEvent("file_upload", "/api/upload", properties)
c.JSON(http.StatusOK, gin.H{
"message": "File uploaded successfully",