From 4a5f8a017d9c17465bcd090d4c4400a9bcf7a7e5 Mon Sep 17 00:00:00 2001 From: niubility000 <76441520+niubility000@users.noreply.github.com> Date: Thu, 16 Dec 2021 11:53:06 +0800 Subject: [PATCH] Add files via upload --- http/preview.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/http/preview.go b/http/preview.go index 48d4ded0..4f88ab3a 100644 --- a/http/preview.go +++ b/http/preview.go @@ -7,7 +7,7 @@ import ( "fmt" "io" "net/http" - + "path/filepath" "github.com/gorilla/mux" "github.com/filebrowser/filebrowser/v2/files" @@ -152,5 +152,6 @@ func createPreview(imgSvc ImgService, fileCache FileCache, } func previewCacheKey(fPath string, fTime int64, previewSize PreviewSize) string { + fPath = filepath.Base(fPath) return fmt.Sprintf("%x%x%x", fPath, fTime, previewSize) }