Commit 27c8b464 by guanzhenshan

调整导出文件方式

parent c7073986
...@@ -2253,9 +2253,18 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers ...@@ -2253,9 +2253,18 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
var filename = "Ebay Paypal明细导出" + DateTime.Now.ToString("yyyyMMddHHmmss"); var filename = "Ebay Paypal明细导出" + DateTime.Now.ToString("yyyyMMddHHmmss");
var filepath = _hostingEnvironment.WebRootPath + "\\Files\\Report\\" + DateTime.Now.ToString("yyyy-MM-dd") + "\\"; var filepath = _hostingEnvironment.WebRootPath + "\\Files\\Report\\" + DateTime.Now.ToString("yyyy-MM-dd") + "\\";
ToCSV(listVal, colNames, guid, filepath); ToCSV(listVal, colNames, guid, filepath);
return File("/Files/Report/" + DateTime.Now.ToString("yyyy-MM-dd") + "/" + guid + ".csv", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", filename + ".csv");
var stream = new System.IO.MemoryStream();
using (System.IO.FileStream fs = new System.IO.FileStream(filepath + filename + ".csv", System.IO.FileMode.OpenOrCreate))
{
stream.CopyTo(fs);
fs.Flush();
}
//return File("/Files/Report/" + DateTime.Now.ToString("yyyy-MM-dd") + "/" + guid + ".csv", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", filename + ".csv");
return File(stream, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", filename + ".csv");
} }
#endregion #endregion
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment