hi to all,
i need code for downloading a page into a doc file.

Recommended Answers

All 3 Replies

hi to all,
i need code for downloading a page into a doc file.

Are you on a Windows OS?
See the PHP COM and .Net interfaces:

http://www.php.net/manual/en/book.com.php
http://www.php.net/manual/en/class.com.php

Reading a file from a URL is as simple as:

$content = file_get_contents('http://example.com/path/to/file.ext');

Then you'll use the COM functions to write it out in .doc format if it isn't already in that format.

the above steps are a good way of doing it with win32...
for a linux server i did this

just write the html code a file with .doc extension . and try opening in microsoft word. it opens perfectly. that's it. its just a gimmick...

from the client side use the document.body.innerHTML and send it to the server either by ajax or post that value to an iframe and do the file creation in php.

the above steps are a good way of doing it with win32...
for a linux server i did this

just write the html code a file with .doc extension . and try opening in microsoft word. it opens perfectly. that's it. its just a gimmick...

from the client side use the document.body.innerHTML and send it to the server either by ajax or post that value to an iframe and do the file creation in php.

Thats good to know. :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.