deleting and uploading files

This commit is contained in:
Daniel Goc
2026-04-02 11:26:58 +02:00
parent b9bc121d43
commit 833f4a5a07
31 changed files with 88 additions and 62 deletions

View File

@@ -5,13 +5,14 @@ import (
"os"
"git.ma-al.com/goc_daniel/b2b/app/model"
"github.com/gofiber/fiber/v3"
)
type UIStorageRepo interface {
EntryInfo(abs_path string) (os.FileInfo, error)
ListContent(abs_path string) (*[]model.EntryInList, error)
OpenFile(abs_path string) (*os.File, error)
UploadFile(abs_path string, f *multipart.FileHeader) error
UploadFile(c fiber.Ctx, abs_path string, f *multipart.FileHeader) error
CreateFolder(abs_path string) error
DeleteFile(abs_path string) error
DeleteFolder(abs_path string) error
@@ -50,8 +51,8 @@ func (r *StorageRepo) OpenFile(abs_path string) (*os.File, error) {
return os.Open(abs_path)
}
func (r *StorageRepo) UploadFile(abs_path string, f *multipart.FileHeader) error {
return nil
func (r *StorageRepo) UploadFile(c fiber.Ctx, abs_path string, f *multipart.FileHeader) error {
return c.SaveFile(f, abs_path)
}
func (r *StorageRepo) CreateFolder(abs_path string) error {