Page 1 of 1
how to open a word or excel file inside a browser
Posted: Fri Jun 26, 2009 4:05 am
by sheikhmdirfan
Dear All,
Is there a way using which we can display a word or excel file inside the browser window...
If yes, then please let me know..
Any help is highly appreciated...
Thanks in advance..
Re: how to open a word or excel file inside a browser
Posted: Fri Jun 26, 2009 6:44 am
by Mark Baker
Not really a PHP question, but
Depends if the user has word/excel installed or not.... and on what precisely you mean by "inside the browser window". If you simply want the user to be able to see word or excel files that exist on the server, then you can offer them a download. This typically prompts for "save or open" the file, and if they have an appropriate program on their PC to allow them to read that file type, then the "open" option will normally open that application. Precise behaviour may vary between browsers and OS platforms, but as you're talking about word and excel, I'd assume most of your users are on a windows platform.
If you mean literally "in the browser", like PDFs or similar, then you'd need to create a browser plug-in capable of reading these files and displaying them.... not the easiest of tasks, especially if you are a novice developer.
Another alternative would be to use a library or tool capable of taking word/excel files, and converting them to HTML.
Re: how to open a word or excel file inside a browser
Posted: Fri Jun 26, 2009 8:54 am
by juma929
Hello,
I've done this in the past with excel. As mentioned it does depend heavily on your OS / Browser versions so it wont exactly be a user friendly solution. Rather offer them the download. If however you want to go ahead and open an excel doc in the window itself whenever possible I believe you can set the appropriate header content type but you will need to research it as I havnt done this in a while, as mentioned, I just offer the download or email it to the user.
Thanks.
Re: how to open a word or excel file inside a browser
Posted: Sat Jun 27, 2009 3:41 pm
by Darhazer
In order to force a file to be opened inside the browser, not downloading it, use the <embed> tag. However, as said in previous posts, user will see it only if it have appropriate plugin
Re: how to open a word or excel file inside a browser
Posted: Sun Jun 28, 2009 12:25 am
by a94060
http://www.codeplex.com/PHPExcel May be of help. As for Word, i dont know one.