Asked By
Malika
290 points
N/A
Posted on - 05/13/2011
We are currently developing a web application. This application allows the facility for a user, to compare documents side by side. There is a requirement to open the document inside Internet Explorer itself. Is this possible?
Answered By
TekGirl
5 points
N/A
#93038
Microsoft Word or Excel files are not opening inside Internet Explorer
In order for Internet Explorer to open up an application, it requires 2 things.
1. The content type header to be sent from the Web Server.
2. The required application mapping is registered in the windows registry.
The content header follows the MIME specification that tells the client browser how to interpret the data stream. For example, all html data is streamed by sending the MIME as "text/html".
The browser will then check its registry for a plug-in that can process the data identified by the content header. If a plug-in is found, it is activated and the data is sent for it for processing.
If no application is found, Internet Explorer prompts the user to save the file.
Answered By
DimaZ
0 points
N/A
#93039
Microsoft Word or Excel files are not opening inside Internet Explorer
When using PHP, you can send the header by using the "header" function.
The following code segment does the needful to open up Microsoft Word file when a link is clicked.
<?PHP
header('Content-type: application/ms-word');
?>
Answered By
Malika
290 points
N/A
#93040
Microsoft Word or Excel files are not opening inside Internet Explorer
Thank you DimaZ and TekGirl for your kind advise.
The computers are all set up with the required software. I have Microsoft Word and Microsoft Excel. I used the code given by DimaZ. But when I click on the link, it still does not open the document inside Internet Explorer.
Answered By
TekGirl
5 points
N/A
#93041
Microsoft Word or Excel files are not opening inside Internet Explorer
Hmm,
We might have to tell the browser that we are sending data that requires to be opened "inline" instead of a new window.
<?PHP
header('Content-type: application/ms-word');
header("Content-Disposition: inline; filename="mywordocument.doc";");
?>
The content disposition header value can either be "attachment" or "inline". When the disposition header is set to attachment, the Internet Explorer forces a file download box. If the disposition is set to inline, Internet Explore will attempt to process it immediately.
Answered By
Malika
290 points
N/A
#93042
Microsoft Word or Excel files are not opening inside Internet Explorer
I modified the code with the disposition as "inline" as requested. The funny thing is, it opens up perfectly on my computer. But it does not open up at the client's PC.
I am clueless as to why!
Answered By
DimaZ
0 points
N/A
#93043
Microsoft Word or Excel files are not opening inside Internet Explorer
What is the software version of Microsoft Office installed at the client's computer?
Displaying inline works with Microsoft Office 2003 and earlier editions by default. If you are using Microsoft Office that is a newer edition, then it will not open inside Internet Explorer. This is due to new security restrictions imposed in latest edition of Office suite of products.
Answered By
TekGirl
5 points
N/A
#93044
Microsoft Word or Excel files are not opening inside Internet Explorer
Well, you can allow the newer version of Microsoft Office to open documents inside Internet Explorer. This requires registry modifications in the client computers.
Modification of registry entries is not recommended as most clients will not be technically sound to perform the task. Furthermore, most of the clients are normal users and not admin users.
Therefore the best recommendation is to stick to the default behavior.
Answered By
Malika
290 points
N/A
#93046
Microsoft Word or Excel files are not opening inside Internet Explorer
The client is using Microsoft Office 2007 where as I am using Microsoft Office 2003.
Taking the advise given by TekGirl and DimaZ, I will explain the client the reason. I am sure he will understand when it is security related.
Thank you again for your advise!