public string UploadImage(string reference, long id, ICollection <IFormFile> file) { var context = new ContextImplement(files: file); var controller = new Pleasanter.Controllers.BinariesController(); var json = controller.UploadImage(context: context, reference: reference, id: id, file: HttpPostedFile.Create(file)); return(json); }
public string DeleteSiteImage(string reference, long id) { var context = new ContextImplement(); var controller = new Pleasanter.Controllers.BinariesController(); var json = controller.DeleteSiteImage(context: context, reference: reference, id: id); return(json); }
public string DeleteTenantImage() { var context = new ContextImplement(); var controller = new Pleasanter.Controllers.BinariesController(); var json = controller.DeleteTenantImage(context: context); return(json); }
public ActionResult TenantImageLogo() { var context = new ContextImplement(); var controller = new Pleasanter.Controllers.BinariesController(); var fileContent = controller.TenantImageLogo(context: context); return(((System.Web.Mvc.FileContentResult)fileContent).ToFileContentResult()); }
public string UpdateTenantImage(ICollection <IFormFile> file) { var context = new ContextImplement(files: file); var controller = new Pleasanter.Controllers.BinariesController(); var json = controller.UpdateTenantImage(context: context, file: HttpPostedFile.Create(file)); return(json); }
public ActionResult SiteImageIcon(string reference, long id) { var context = new ContextImplement(); var controller = new Pleasanter.Controllers.BinariesController(); var fileContent = controller.SiteImageIcon(context: context, reference: reference, id: id); return(((System.Web.Mvc.FileContentResult)fileContent).ToFileContentResult()); }
public ActionResult ShowTemp(string reference, string guid) { var context = new ContextImplement(); var controller = new Pleasanter.Controllers.BinariesController(); var fileContent = controller.ShowTemp(context: context, reference: reference, guid: guid); return(fileContent != null ? File(fileContent.FileContents, fileContent.ContentType) : null); }
public ActionResult Show(string reference, string guid) { var context = new ContextImplement(); var controller = new Pleasanter.Controllers.BinariesController(); var file = controller.Show(context: context, reference: reference, guid: guid); if (file == null) { return(RedirectToAction("notfound", "errors")); } return(File(file.FileContents, file.ContentType)); }
public ActionResult DownloadTemp(string reference, string guid) { var context = new ContextImplement(); var controller = new Pleasanter.Controllers.BinariesController(); var file = controller.DownloadTemp(context: context, reference: reference, guid: guid); if (file == null) { return(RedirectToAction("notfound", "errors")); } return(ConvertToFileStreamResult(file)); }
public ActionResult Upload(long id) { var files = Request.Form.Files; var context = new ContextImplement(files: files.ToList()); var controller = new Pleasanter.Controllers.BinariesController(); var contentRangeHeader = Request.Headers["Content-Range"]; var matches = System.Text.RegularExpressions.Regex.Matches(contentRangeHeader.FirstOrDefault() ?? string.Empty, "\\d+"); var contentRange = matches.Count > 0 ? new System.Net.Http.Headers.ContentRangeHeaderValue( long.Parse(matches[0].Value), long.Parse(matches[1].Value), long.Parse(matches[2].Value)) : null; var content = controller.Upload(context: context, id: id, contentRange: contentRange); return(new ContentResult() { Content = content, ContentType = "applicaion/json", }); }