Error for saving to xlsx

Hi

aspose.cells not work in chrome,what`s wrong?

Error Message as below:

Failed to load resource: net::ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_DISPOSITIONFailed to load resource: net::ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_DISPOSITION

My Code as below:

HttpContext curContext = HttpContext.Current;
string strHZ = string.Format("{0:yyyy-MM-dd_HHmmss}", DateTime.Now);
strFileName = strFileName + "_" + strHZ;// +".xlsx";
curContext.Response.ContentType = "application/vnd.ms-excel";
curContext.Response.ContentEncoding = Encoding.UTF8;
curContext.Response.Charset = "GB2312";
curContext.Response.AppendHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode(strFileName, Encoding.UTF8) + ".xlsx");

workbook.Save(curContext.Response, strFileName, ContentDisposition.Attachment, new OoxmlSaveOptions());
curContext.Response.End();

Hi,

Thanks for your posting and using Aspose.Cells.

Please provide us your sample project so that we could investigate this issue at our end. We will look into it and let you know the sample code or workaround to resolve this issue.

Hi,


Please either use the lines of code i.e.,:

string strHZ = string.Format(“{0:yyyy-MM-dd_HHmmss}”, DateTime.Now);
strFileName = strFileName + “_” + strHZ;// +“.xlsx”;
curContext.Response.ContentType = “application/vnd.ms-excel”;
curContext.Response.ContentEncoding = Encoding.UTF8;
curContext.Response.Charset = “GB2312”;
curContext.Response.AppendHeader(“Content-Disposition”, “attachment;filename=” + HttpUtility.UrlEncode(strFileName, Encoding.UTF8) + “.xlsx”);

or the line of code:

workbook.Save(curContext.Response, strFileName, ContentDisposition.Attachment, new OoxmlSaveOptions());

from your code segment.


For further reference, please see the document:
http://www.aspose.com/docs/display/cellsnet/Saving+Files
(Note: please see the description and example(s) under “Saving File to Response Object
” sub-topic)

Thank you.