public async Task <ActionResult> SaveDoc() { PageOfficeNetCore.FileSaver fs = new PageOfficeNetCore.FileSaver(Request, Response); await fs.LoadAsync(); string webRootPath = _webHostEnvironment.WebRootPath; fs.SaveToFile(webRootPath + "/SaveAsMHT/doc/" + fs.FileName); fs.Close(); return(Content("OK")); }
public async Task <ActionResult> SaveDoc() { PageOfficeNetCore.FileSaver fs = new PageOfficeNetCore.FileSaver(Request, Response); await fs.LoadAsync(); string webRootPath = _webHostEnvironment.WebRootPath; fs.SaveToFile(webRootPath + "/InsertPageBreak2/doc/" + "test3.doc"); fs.CustomSaveResult = "ok"; fs.Close(); return(Content("OK")); }
public async Task <ActionResult> SaveDoc() { string id = Request.Query["id"]; PageOfficeNetCore.FileSaver fs = new PageOfficeNetCore.FileSaver(Request, Response); await fs.LoadAsync(); string fileName = "maker" + id + fs.FileExtName; string webRootPath = _webHostEnvironment.WebRootPath; fs.SaveToFile(webRootPath + "/PrintFiles/doc/" + fileName); fs.Close(); return(Content("OK")); }
public async Task <ActionResult> POSaveDoc() { PageOfficeNetCore.FileSaver fs = new PageOfficeNetCore.FileSaver(Request, Response); await fs.LoadAsync(); string webRootPath = _webHostEnvironment.WebRootPath; string contentRootPath = _webHostEnvironment.ContentRootPath; fs.SaveToFile(webRootPath + "/POBrowser/doc/" + fs.FileName); await Response.Body.WriteAsync(Encoding.GetEncoding("GB2312").GetBytes(fs.FileName)); fs.ShowPage(300, 300); fs.Close(); return(Content("OK")); }
public async Task <ActionResult> SaveDoc() { string type = Request.Query["type"].ToString(); PageOfficeNetCore.FileSaver fs = new PageOfficeNetCore.FileSaver(Request, Response); await fs.LoadAsync(); string webRootPath = _webHostEnvironment.WebRootPath; if ("2" == type) { fs.SaveToFile(webRootPath + "/doc/" + "filemaker.doc"); } else { fs.SaveToFile(webRootPath + "/doc/" + fs.FileName); } fs.Close(); return(Content("OK")); }
public async Task <ActionResult> SaveDoc() { PageOfficeNetCore.FileSaver fs = new PageOfficeNetCore.FileSaver(Request, Response); await fs.LoadAsync(); string webRootPath = _webHostEnvironment.WebRootPath; if (fs.FileExtName.Equals(".jpg")) { fs.SaveToFile(webRootPath + "/SaveFirstPageAsImg/images/" + fs.FileName); } else { fs.SaveToFile(webRootPath + "/SaveFirstPageAsImg/doc/" + fs.FileName); } fs.CustomSaveResult = "ok"; fs.Close(); return(Content("OK")); }
public async Task <ActionResult> SaveDoc() { PageOfficeNetCore.FileSaver fs = new PageOfficeNetCore.FileSaver(Request, Response); await fs.LoadAsync(); string id = Request.Query["id"].ToString().Trim(); string content = fs.DocumentText; SqliteConnection conn = new SqliteConnection(connString); conn.Open(); string sql = "update word set Content='" + content + "' where id=" + id; SqliteCommand cmd = new SqliteCommand(sql, conn); cmd.CommandType = CommandType.Text; cmd.ExecuteNonQuery(); string webRootPath = _webHostEnvironment.WebRootPath; fs.SaveToFile(webRootPath + "/SaveAndSearch/doc/" + fs.FileName); fs.Close(); return(Content("OK")); }
public async Task <ActionResult> SaveDoc() { PageOfficeNetCore.FileSaver fs = new PageOfficeNetCore.FileSaver(Request, Response); await fs.LoadAsync(); string id = Request.Query["id"]; string sql = "UPDATE Stream SET Word=@file where ID=" + id; using (SqliteConnection conn = new SqliteConnection(connString)) { conn.Open(); byte[] aa = fs.FileBytes; using (SqliteCommand cmd = new SqliteCommand(sql, conn)) { SqliteParameter parameter = new SqliteParameter("@file", SqliteType.Blob); parameter.Value = aa; cmd.Parameters.Add(parameter); cmd.ExecuteNonQuery(); } } fs.Close(); return(Content("OK")); }