diff --git a/routers/repo/attachment.go b/routers/repo/attachment.go index 62bdc2ea7..cab123d30 100755 --- a/routers/repo/attachment.go +++ b/routers/repo/attachment.go @@ -422,14 +422,13 @@ func GetSuccessChunks(ctx *context.Context) { return } } else { - isExist, err = storage.ObsHasObject(models.AttachmentRelativePath(fileChunk.UUID)) + isExist, err = storage.ObsHasObject(setting.BasePath + models.AttachmentRelativePath(fileChunk.UUID) + "/" + fileChunk.UUID) if err != nil { ctx.ServerError("ObsHasObject failed", err) return } } - if isExist { if fileChunk.IsUploaded == models.FileNotUploaded { log.Info("the file has been uploaded but not recorded") @@ -692,15 +691,17 @@ func CompleteMultipart(ctx *context.Context) { } if attachment.DatasetID != 0 { - if strings.HasSuffix(attachment.Name, ".zip") { - err = worker.SendDecompressTask(contexExt.Background(), uuid) - if err != nil { - log.Error("SendDecompressTask(%s) failed:%s", uuid, err.Error()) - } else { - attachment.DecompressState = models.DecompressStateIng - err = models.UpdateAttachment(attachment) + if typeCloudBrain == models.TypeCloudBrainOne { + if strings.HasSuffix(attachment.Name, ".zip") { + err = worker.SendDecompressTask(contexExt.Background(), uuid) if err != nil { - log.Error("UpdateAttachment state(%s) failed:%s", uuid, err.Error()) + log.Error("SendDecompressTask(%s) failed:%s", uuid, err.Error()) + } else { + attachment.DecompressState = models.DecompressStateIng + err = models.UpdateAttachment(attachment) + if err != nil { + log.Error("UpdateAttachment state(%s) failed:%s", uuid, err.Error()) + } } } } diff --git a/web_src/js/components/MinioUploader.vue b/web_src/js/components/MinioUploader.vue index c453daf16..3ece6994e 100755 --- a/web_src/js/components/MinioUploader.vue +++ b/web_src/js/components/MinioUploader.vue @@ -21,6 +21,7 @@ import qs from 'qs'; import createDropzone from '../features/dropzone.js'; const {_AppSubUrl, _StaticUrlPrefix, csrf} = window.config; +const CloudBrainType = 0; export default { data() { @@ -245,8 +246,8 @@ export default { file_name: file.name, size: file.size, dataset_id: file.datasetId, - _csrf: csrf, - type:0 + type: CloudBrainType, + _csrf: csrf }) ); } @@ -284,6 +285,7 @@ export default { md5: file.uniqueIdentifier, size: file.size, fileType: file.type, + type: CloudBrainType, _csrf: csrf } }); @@ -324,6 +326,7 @@ export default { uploadID: file.uploadID, size: partSize, chunkNumber: currentChunk + 1, + type: CloudBrainType, _csrf: csrf } }); @@ -382,6 +385,7 @@ export default { file_name: file.name, size: file.size, dataset_id: file.datasetId, + type: CloudBrainType, _csrf: csrf }) ); diff --git a/web_src/js/components/ObsUploader.vue b/web_src/js/components/ObsUploader.vue index 0e9e7d2eb..16b53d343 100755 --- a/web_src/js/components/ObsUploader.vue +++ b/web_src/js/components/ObsUploader.vue @@ -4,22 +4,24 @@ id="dataset" class="dropzone" /> -

{{ file_status_text }} {{ status }}

- +