views:

555

answers:

2

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.

A: 

On RIM they say you should use BES to view PDF, DOC etc
I've test it: ASP.NET site with simple < a href ="...">< /a > link to doc file + MDS simulator + 9350 device emulator. Results same as in forum topic:

Socket Channel not able to connect; address 127.0.0.1:1900

Unfortunately can't test it on BES, but you should try it.

My opinion is BES allows to view office files with DocsToGo opened with simple links.

Max Gontar
Thanks for trying to help, coldice.
Sorin Comanescu
Youre welcome )
Max Gontar
A: 

Actually I was a bit misguided by user's feedback: after further investigating this issue, it came out that only Excel files failed to open, not all Office files.

After changing the MIME type from "application/excel" to "application/vnd.ms-excel" it worked fine.

Sorin Comanescu