January 6, 200917 yr Hi got a question is there a way to read ms word documents using php? searched for ages all i was able to find is various discussions on how bad the microsoft products are... blha blah blah... what i want is to convert ms word document into html using php and store that in database is there a way to do that?
January 6, 200917 yr Hi got a questionis there a way to read ms word documents using php? searched for ages all i was able to find is various discussions on how bad the microsoft products are... blha blah blah... what i want is to convert ms word document into html using php and store that in database is there a way to do that? Is the doc on a server? that needs to be ran through PHP and then put into a DB (I'm assuming MySQL here). And does this task need to be run on demand? Like if someone uploads the doc and needs to be converted to html and then stored? Or is the Document just on your PC that you need to do once? B.
January 6, 200917 yr Author Is the doc on a server? that needs to be ran through PHP and then put into a DB (I'm assuming MySQL here). And does this task need to be run on demand? Like if someone uploads the doc and needs to be converted to html and then stored? Or is the Document just on your PC that you need to do once? B. it is preferable for the task to run on demand, so i could just stick that stuff right into the database MySQL without having to keep the document on the server
January 6, 200917 yr is it docx or doc? If its docx its relatively easy as the Office 2007 formats are all Zip files containing xml data. Doc and other old Office formats are a right james blunt to work with - the way i do it is install a package onto the server itself (that is, install a command line program from a .deb/.rpm package file) and use the shell() or term() functions in php to make them parse it into XML and read from there.
January 6, 200917 yr Author is it docx or doc? If its docx its relatively easy as the Office 2007 formats are all Zip files containing xml data. Doc and other old Office formats are a right james blunt to work with - the way i do it is install a package onto the server itself (that is, install a command line program from a .deb/.rpm package file) and use the shell() or term() functions in php to make them parse it into XML and read from there. i am more interested in old ones, and is there a way to do it without installing any packages?
January 7, 200917 yr Ive tried doing it using a plain PHP script but it just didnt work for me - that was using a 3mb excel spreadsheet though so you may have better luck. If you are fine installing packages the ones you need are "antiword" (.doc) and "xlhtml" (.xls). These might be available as standalone shell scripts, but I'm not sure. A final and convoluted way I investigated before finding the packages was to upload them to Google Docs via the API and read them across the net... not very fast and a bit too insecure for the data i was using...
Create an account or sign in to comment