diff --git a/modules/storage/obs.go b/modules/storage/obs.go index a68bb7771..8e6b4201b 100755 --- a/modules/storage/obs.go +++ b/modules/storage/obs.go @@ -57,8 +57,8 @@ func ObsHasObject(path string) (bool, error) { return hasObject, nil } -func GetObsPartInfos(uuid string, uploadID string) (string, error) { - key := strings.TrimPrefix(path.Join(setting.BasePath, path.Join(uuid[0:1], uuid[1:2], uuid, uuid)), "/") +func GetObsPartInfos(uuid, uploadID, fileName string) (string, error) { + key := strings.TrimPrefix(path.Join(setting.BasePath, path.Join(uuid[0:1], uuid[1:2], uuid, fileName)), "/") output, err := ObsCli.ListParts(&obs.ListPartsInput{ Bucket: setting.Bucket, diff --git a/routers/repo/attachment.go b/routers/repo/attachment.go index 8443d6488..c2d096416 100755 --- a/routers/repo/attachment.go +++ b/routers/repo/attachment.go @@ -542,7 +542,7 @@ func GetSuccessChunks(ctx *context.Context) { log.Error("GetPartInfos failed:%v", err.Error()) } } else { - chunks, err = storage.GetObsPartInfos(fileChunk.UUID, fileChunk.UploadID) + chunks, err = storage.GetObsPartInfos(fileChunk.UUID, fileChunk.UploadID, fileName) if err != nil { log.Error("GetObsPartInfos failed:%v", err.Error()) } diff --git a/web_src/js/components/ObsUploader.vue b/web_src/js/components/ObsUploader.vue index 9da601b74..b20594b86 100755 --- a/web_src/js/components/ObsUploader.vue +++ b/web_src/js/components/ObsUploader.vue @@ -355,10 +355,9 @@ export default { xhr.open('PUT', url, false); xhr.setRequestHeader('Content-Type', '') xhr.send(e.target.result); - var etagValue = xhr.getResponseHeader('etag'); + var etagValue = xhr.getResponseHeader('ETag'); //console.log(etagValue); etags[currentChunk] = etagValue; - console.log(etagValue) } async function updateChunk(currentChunk) {