Skip to content

Commit

Permalink
add filter
Browse files Browse the repository at this point in the history
  • Loading branch information
LinkLeong committed Aug 31, 2023
1 parent 38c7b5a commit eedfdde
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions route/v1/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,10 @@ func GetFileUpload(c *gin.Context) {
path := c.Query("path")
dirPath := ""
hash := file.GetHashByContent([]byte(fileName))
if file.Exists(path + "/" + relative) {
c.JSON(http.StatusConflict, model.Result{Success: http.StatusConflict, Message: common_err.GetMsg(common_err.FILE_ALREADY_EXISTS)})
return
}
tempDir := filepath.Join(path, ".temp", hash+strconv.Itoa(totalChunks)) + "/"
if fileName != relative {
dirPath = strings.TrimSuffix(relative, fileName)
Expand Down

0 comments on commit eedfdde

Please sign in to comment.