|
|
|
@@ -203,24 +203,22 @@ func GetPresignedPutObjectURL(ctx *context.Context) { |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
uuid := "" |
|
|
|
url := "" |
|
|
|
|
|
|
|
if setting.Attachment.StoreType == storage.MinioStorageType { |
|
|
|
uuid = gouuid.NewV4().String() |
|
|
|
uuid := gouuid.NewV4().String() |
|
|
|
url, err := storage.Attachments.PresignedPutURL(models.AttachmentRelativePath(uuid)) |
|
|
|
if err != nil { |
|
|
|
ctx.ServerError("PresignedPutURL", err) |
|
|
|
return |
|
|
|
} |
|
|
|
log.Trace(url) |
|
|
|
|
|
|
|
ctx.JSON(200, map[string]string{ |
|
|
|
"uuid": uuid, |
|
|
|
"url": url, |
|
|
|
}) |
|
|
|
} else { |
|
|
|
ctx.Error(404, "storage type is not enabled") |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
ctx.JSON(200, map[string]string{ |
|
|
|
"uuid": uuid, |
|
|
|
"url": url, |
|
|
|
}) |
|
|
|
|
|
|
|
} |