public ActionResult UploadResource(string container) { if (this.Request.Files.Count > 1) { return(this.Failed("Only single file may be uploaded", HttpStatusCode.BadRequest)); } var file = this.Request.Files[0]; if (file == null) { return(this.Failed("No file was uploaded", HttpStatusCode.BadRequest)); } try { var uploader = new ResourceUploader(file, container); uploader.Upload(this.Tenant); } catch (ResourceUploadException ex) { return(this.Failed(ex.Message, HttpStatusCode.InternalServerError)); } return(this.Ok()); }
public ActionResult UploadResource(string themeName, string container) { if (this.Request.Files.Count > 1) { return(this.Failed(Resources.OnlyASingleFileMayBeUploaded, HttpStatusCode.BadRequest)); } var file = this.Request.Files[0]; if (file == null) { return(this.Failed(Resources.NoFileWasUploaded, HttpStatusCode.BadRequest)); } try { var uploader = new ResourceUploader(file, themeName, container); uploader.Upload(this.Tenant); } catch (ResourceUploadException ex) { return(this.Failed(ex.Message, HttpStatusCode.InternalServerError)); } return(this.Ok()); }