Hi,
We have a Web application (ASP.NET) which displays in some page links to miscellaneous Office documents.
The links are not to web files but rather to a web page which dynamically loads the content form a network folder then sends it to the browser by appropriately setting the mime type.
Everything works fine when testing with desktop browsers (a.k.a. the browser proposes the right application to open the file and the file is successfully opened).
When testing with a Blackberry (Bold 9000) the built-in browser raises an error message stating the selected item (an Excel document) cannot be displayed.
The odd thing is Excel files attached to mail messages can be opened on the same device (via Documents To Go I think).
Anybody has an idea why the Excel attachment could be opened as email attachment but not when downloaded from web? Could this be caused by an incorrect MIME type setting?
Please note that the Blackberry testing was done only by a (remote) user as the BB used for development has an older OS (4.3) which doesn't support Office files anyway. I am not able to actually test with a 4.5+ BB.
Here's the code (excerpts, f is a FileInfo):
Response.Clear();
Response.ClearHeaders();
Response.ClearContent();
Response.AddHeader("Content-Length", f.Length.ToString());
Response.ContentType = "application/excel" // for xls files
Response.AddHeader("Content-Disposition", "inline; filename=" + f.Name);
Response.WriteFile(f.FullName);
Response.Flush();
Response.Close();
Response.End();
I am going to try different mime types as documented on filext.com but, as this is going to take a while because of physical device unavailability, if anybody has a clue I'd be glad to hear about it. I'll keep this posted if I find a solution.
Thanks.