Add files via upload

This commit is contained in:
niubility000 2021-12-18 01:03:27 +08:00 committed by GitHub
parent bc21a7d0d3
commit d6598a56b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -7,9 +7,8 @@ import (
"fmt" "fmt"
"io" "io"
"net/http" "net/http"
"github.com/gorilla/mux" "github.com/gorilla/mux"
"path/filepath"
"github.com/filebrowser/filebrowser/v2/files" "github.com/filebrowser/filebrowser/v2/files"
"github.com/filebrowser/filebrowser/v2/img" "github.com/filebrowser/filebrowser/v2/img"
) )
@ -153,6 +152,6 @@ func createPreview(imgSvc ImgService, d *data, fileCache FileCache,
} }
func previewCacheKey(fPath string, fTime int64, previewSize PreviewSize, d *data) string { func previewCacheKey(fPath string, fTime int64, previewSize PreviewSize, d *data) string {
fPath = d.user.Scope + fPath fPath = filepath.Clean("/"+ d.user.Scope + fPath)
return fmt.Sprintf("%x%x%x", fPath, fTime, previewSize) return fmt.Sprintf("%x%x%x", fPath, fTime, previewSize)
} }