fix(files): disable auto renaming and clean path from request
This commit is contained in:
parent
4de972cb11
commit
0e77cfe335
8 changed files with 108 additions and 87 deletions
|
@ -133,10 +133,12 @@ func ErrResp(c *gin.Context, code int, err error) (int, interface{}) {
|
|||
}
|
||||
|
||||
func FsRootPath(userName, relFilePath string) string {
|
||||
relFilePath = filepath.Clean(relFilePath)
|
||||
return filepath.Join(userName, FsRootDir, relFilePath)
|
||||
}
|
||||
|
||||
func UploadPath(userName, relFilePath string) string {
|
||||
relFilePath = filepath.Clean(relFilePath)
|
||||
return filepath.Join(UploadFolder(userName), fmt.Sprintf("%x", sha1.Sum([]byte(relFilePath))))
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue