diff options
-rw-r--r-- | system/admin/filesystem.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/system/admin/filesystem.go b/system/admin/filesystem.go index e556ec8..758966b 100644 --- a/system/admin/filesystem.go +++ b/system/admin/filesystem.go @@ -26,8 +26,8 @@ func deleteUploadFromDisk(target string) error { // split and rebuild path in OS friendly way // use path to delete the physical file from disk - pathSplit := strings.Split(upload.Path, "/") - pathJoin := filepath.Join(pathSplit[2:]...) + pathSplit := strings.Split(strings.TrimPrefix(upload.Path, "/api/"), "/") + pathJoin := filepath.Join(pathSplit...) err = os.Remove(pathJoin) if err != nil { return err |