mirror of
https://codeberg.org/scip/ephemerup.git
synced 2025-12-17 04:30:57 +01:00
put shared code into own mod (common), + apicontext env vars
This commit is contained in:
@@ -22,6 +22,7 @@ import (
|
||||
"errors"
|
||||
"github.com/gofiber/fiber/v2"
|
||||
"github.com/tlinden/cenophane/cfg"
|
||||
"github.com/tlinden/cenophane/common"
|
||||
"io"
|
||||
"mime/multipart"
|
||||
"os"
|
||||
@@ -43,7 +44,7 @@ func cleanup(dir string) {
|
||||
func SaveFormFiles(c *fiber.Ctx, cfg *cfg.Config, files []*multipart.FileHeader, id string) ([]string, error) {
|
||||
members := []string{}
|
||||
for _, file := range files {
|
||||
filename, _ := Untaint(filepath.Base(file.Filename), cfg.RegNormalizedFilename)
|
||||
filename, _ := common.Untaint(filepath.Base(file.Filename), cfg.RegNormalizedFilename)
|
||||
path := filepath.Join(cfg.StorageDir, id, filename)
|
||||
members = append(members, filename)
|
||||
Log("Received: %s => %s/%s", file.Filename, id, filename)
|
||||
|
||||
Reference in New Issue
Block a user