Add setup-flow

This commit is contained in:
2026-03-21 03:12:13 +01:00
parent 80a2f662dc
commit dd044cf5d0
17 changed files with 519 additions and 37 deletions

View File

@@ -7,6 +7,7 @@ import (
type FileRecord struct {
ID string `gorm:"primaryKey" json:"id"`
DeletionID string `json:"deletion_id"`
ViewID string `json:"view_id"`
Filename string `json:"filename"`
Path string `json:"-"` // file path on disk (not exposed via JSON)
ExpiresAt time.Time `json:"expires_at"`

View File

@@ -3,6 +3,7 @@ package file
import (
"io"
"os"
"path/filepath"
"time"
"github.com/google/uuid"
@@ -29,7 +30,8 @@ func (s *Service) UploadFile(filename string, data io.Reader, deleteAfterDownloa
return nil, err
}
path := folderPath + "/" + filename
safeName := uuid.NewString() + filepath.Ext(filename)
path := filepath.Join(folderPath, safeName)
out, err := os.Create(path)
if err != nil {