diff --git a/routers/repo/attachment.go b/routers/repo/attachment.go index bc843c5557..6681691105 100755 --- a/routers/repo/attachment.go +++ b/routers/repo/attachment.go @@ -512,7 +512,12 @@ func GetSuccessChunks(ctx *context.Context) { return } } else { - isExist, err = storage.ObsHasObject(setting.BasePath + models.AttachmentRelativePath(fileChunk.UUID) + "/" + fileName) + oldFileName := fileName + oldAttachment, _ := models.GetAttachmentByUUID(fileChunk.UUID) + if oldAttachment != nil { + oldFileName = oldAttachment.Name + } + isExist, err = storage.ObsHasObject(setting.BasePath + models.AttachmentRelativePath(fileChunk.UUID) + "/" + oldFileName) if err != nil { ctx.ServerError("ObsHasObject failed", err) return