Unreadable Content on 1 site, not on other.

Mar 7, 2013 at 3:08 PM
Hi all,

I've noticed there's a bunch of these "unreadable content" posts, but I still think mine is a little different.

When I run the code on my development machine, everything runs fine and I get no errors.
When I run the code on one of the servers in the webfarm, I get the unreadable content error.

I'm not quite sure if there's any prerequisites, but I couldn't find any references to them.

Any suggestions are appreciated!

Thank you for your time.
Mar 7, 2013 at 9:09 PM
Edited Mar 7, 2013 at 9:10 PM
As far as I know there are two ways to save the ExcelPackage to a file. The first is a simple excelPackage.Save(); which works for me. The second way below prompts the user where to save the spreadsheet but produces a corrupted spreadsheet.
    Response.BinaryWrite(excelPackage.GetAsByteArray());
    Response.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
    Response.AddHeader("content-disposition", "attachment;  filename=Sample2.xlsx");