示例#1
0
        public async Task <IActionResult> GetMultipleUploadUrlv2([FromQuery] MultiPartUploadInputModel model)
        {
            if (!ModelState.IsValid)
            {
                return(JsonBadRequest("Invalid inputs."));
            }
            if (model.PartSum == 0)
            {
                return(JsonBadRequest("The uploading file can not be parted. The file may be empty (0 byte)."));
            }
            ResourceType type;

            if (Enum.TryParse(model.Type, true, out type) == false)
            {
                LogDebug("有効なリソースタイプが指定されていません。");
                return(JsonBadRequest($"Unexpected resource type { model.Type}"));
            }
            return(JsonOK(await storageLogic.GetPartUploadPreSignedUrlAsync(type, model.FileName, model.PartSum)));
        }