Skip to content

Commit eedfdde

Browse files
committed
add filter
1 parent 38c7b5a commit eedfdde

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

route/v1/file.go

+4
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,10 @@ func GetFileUpload(c *gin.Context) {
480480
path := c.Query("path")
481481
dirPath := ""
482482
hash := file.GetHashByContent([]byte(fileName))
483+
if file.Exists(path + "/" + relative) {
484+
c.JSON(http.StatusConflict, model.Result{Success: http.StatusConflict, Message: common_err.GetMsg(common_err.FILE_ALREADY_EXISTS)})
485+
return
486+
}
483487
tempDir := filepath.Join(path, ".temp", hash+strconv.Itoa(totalChunks)) + "/"
484488
if fileName != relative {
485489
dirPath = strings.TrimSuffix(relative, fileName)

0 commit comments

Comments
 (0)