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..
how to open a word or excel file inside a browser
Moderator: General Moderators
-
sheikhmdirfan
- Forum Newbie
- Posts: 22
- Joined: Tue Jan 20, 2009 12:21 am
-
Mark Baker
- Forum Regular
- Posts: 710
- Joined: Thu Oct 30, 2008 6:24 pm
Re: how to open a word or excel file inside a browser
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.
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
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.
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
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
http://www.codeplex.com/PHPExcel May be of help. As for Word, i dont know one.