public async Task<IHttpActionResult> PostBlobUpload()
{
try
{
// This endpoint only supports multipart form data
if (!Request.Content.IsMimeMultipartContent("form-data"))
{
return StatusCode(HttpStatusCode.UnsupportedMediaType);
}
// Call service to perform upload, then check result to return as content
var result = await _service.UploadBlobs(Request.Content);
if (result != null && result.Count > 0)
{
return Ok(result);
}
// Otherwise
return BadRequest();
}
catch (Exception ex)
{
return InternalServerError(ex);
}
}