hello,
I have an issue when I try to open xlsx file after converting html to xlsx.
all things are fine until I send the Binary result on using Response.BinaryWrite.
example:
Response.ContentType = “application/xlsx”;
Response.AddHeader(“Content-disposition”, $“attachment;filename=Filename.xlsx;”);
var result = Encoding.Default.GetBytes(document);
//ByteArrayToFile(@“export.xlsx”, result); at this step if I save the Binary directly in file it’s work.
Response.BinaryWrite(result);
the result when I download th content in my front. I have this message :
We’re sorry. We can’t open {file} because we found a problem with its contents.
image.png (4.4 KB)
it’s opend when I click on OK.
I want to avoid this message please help me.