We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 38c7b5a commit eedfddeCopy full SHA for eedfdde
route/v1/file.go
@@ -480,6 +480,10 @@ func GetFileUpload(c *gin.Context) {
480
path := c.Query("path")
481
dirPath := ""
482
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
+ }
487
tempDir := filepath.Join(path, ".temp", hash+strconv.Itoa(totalChunks)) + "/"
488
if fileName != relative {
489
dirPath = strings.TrimSuffix(relative, fileName)
0 commit comments