Click here to Skip to main content
15,895,777 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Hi I have an web application project. for some clients there is a problem with opening xlsx attachments directly from firefox without saving.
When they open the attachment the format is damaged.
But when they save the attachment and then open it, there is no problem.
Dose anyone know what the problem can be?

What I have tried:

Firefox application options and other settings.
remove old versions of Microsoft office .
Posted
Updated 29-Aug-19 6:06am
Comments
Patrice T 5-Mar-16 14:43pm    
Explain where the attachment come from, and how you open it.
Sara NA 6-Mar-16 0:30am    
all of the attachments are saved as filestream in sql.
other types of the extensions have no problem.
to show them, i use hypelink and then i use a ashx page to show the attachment by the code bellow :

FileByte = Dt.Rows(0).Item("FileData")
context.Response.ContentType = cCommonMethod.GetOfficeFileExtention(Extension)
context.Response.BinaryWrite(FileByte)
Patrice T 6-Mar-16 5:50am    
Excel write in its files when open.
if file does not exist it may be your problem.
Sara NA 8-Mar-16 3:24am    
what is your mean?

1 solution

Pls add
Response.ContentType = "application/vnd.xls";
 
Share this answer
 
Comments
Dave Kreskowiak 29-Aug-19 12:23pm    
That's not a valid content type. The Excel content types are
"application.vnd.ms-excel" and "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900