I’ve recently created a PHP application that opens a newly created Microsoft Word document as an rtf file i.e. 991149.rtf is created in an existing directory on the server (Microsoft Windows 2000 using IIS)
It’s been an experience! But I’m left with three problems that I can’t find the answer for no matter how hard I’ve tried and searched over the last few days, anyways…
The first, and most important, problem is when a new document is opened on the client machine (XP Pro)…
On the Word title bar it will say ‘991149.rtf (Read Only)’
How do I make it read and write?
The code that creates the file on the server looks something like this:-
Code: Select all
$fp = fopen( $szFile, "w+b" );
fwrite( $fp, $rtf );
fclose( $fp );Lastly, when I click on the hyperlink that starts the creating a Word document off, it opens another blank web page (which has run the PHP code to create the word document).
When I click on 'Open' in the download dialogue box - because it has downloaded the rtf file from the server, this new blank web page still hangs around. How can I kill it after I’ve clicked on open download?
Your help on any or all of these questions would be greatly appreciated.
Many thanks in advance and for you patience in reading this.
Cheers,
Tom