Exemplo n.º 1
0
        public async Task <ActionResult> UploadAsynce()
        {
            try
            {
                var request = await HttpContext.Request.ReadFormAsync();

                if (request.Files == null)
                {
                    return(BadRequest("Could not upload files"));
                }
                var files = request.Files;
                if (files.Count == 0)
                {
                    return(BadRequest("Could not upload empty files"));
                }

                await _azureBlobService.UploadAsynce(files);

                return(RedirectToAction("List"));
            }
            catch (Exception ex)
            {
                ViewData["message"] = ex.Message;
                ViewData["trace"]   = ex.StackTrace;
                return(View("Error"));
            }
        }