Security error on download


#1

Hi,

I just switched to version 3.7.2.0 from 3.7 and I get a 'Security WArning' on download and the Excel file does not open,

I am using the following code to open the file in the browser.

excel.Save("test.xls", SaveType.OpenInExcel, FileFormatType.Default, this.Response);

Please let me know how to resolve this. I tried putting the Aspose.cells binary in the GAC but that did not solve the issue.

Thanks,

Aarti


#2

Hi Aarti,

We don't make any change on security from 3.7 to 3.7.2. Maybe it's a deployment issue.

Have you remove reference to old aspose.cells.dll and re-add reference to the new dll in the project? After doing it, please rebuild your program. Aspose.Cells is a strong named dll so you have to rebuild your application.


#3

Thanks Laurence. I did compile the code with the new dll, but I still get the same error that IE tries to download file.aspx?format=EXCEL and if I click OK it says 'Could not open page https//url/file.aspx?format=excel'

When i replace the orignal dll compiled with 3.7 it works. ALso I checked my IE settings and they are teh same as before. Please let me know if there is anything else I can try out.

Thanks,
Aarti


#4

Hi Aarti,

In v3.7.2, to solve an issue with http compression, we change some http header in Reponse object. This may cause your problem. You can try this piece of code:

MemoryStream stream = new MemoryStream();

excel.Save(stream, FileFormatType.Default);

byte[] data = stream.ToArray();

this.Response.ContentType = "application/xls";
Response.AddHeader( "content-disposition","attachment; filename=test.xls");
Response.BinaryWrite(data1);
Response.End();


#5

Thanks so much Laurence! That solved my issue…