Digital Point Forums
San Diego Personal Trainer

Go Back   Digital Point Forums > Design & Development > Programming > PHP
Google Analytics
Log In to view
your analytics

Reply
 
Thread Tools
  #1  
Old May 9th 2008, 12:42 am
ksamir2004 ksamir2004 is offline
Grunt
 
Join Date: Mar 2008
Posts: 70
ksamir2004 is on a distinguished road
Save online msdocument in server

Hi all,

i want to create word document in server and save it to in server..
i got script but this script create word document in client machine..
Can any one help me to write this script.

Quote:
<?php
header('Content-type: application/msword');
header('Content-Disposition: attachment; filename="download.doc"');
readfile('thefilename of the doc');
?>
__________________
Thanks,
Sam
Reply With Quote
  #2  
Old May 9th 2008, 6:56 am
ketan9 ketan9 is offline
Twilight Vanquisher
 
Join Date: Jul 2006
Posts: 510
ketan9 is on a distinguished road
You need a windows server to do what you are asking for. Here's a small sample for you
Quote:
<?php
$word = new COM("word.application") or die ("couldnt create an instance of word");
echo "loaded , word version{$word->version}";
//bring word to the front
$word->visible = 1;
//open a word document
$word->Documents->Add();
//add some text to the document
$word->Selection->TypeText("this is some sample text in the document");
//save the document as sampleword.doc
$word->Documents[1]->SaveAs("sampleword.doc");
//close word
$word->Quit();
//free object resources
$word->Release();
$word = null;
?>
More details at http://www.programmershelp.co.uk/phpcreateword.php
Reply With Quote
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[UK] Fully Managed Dedicated Server - Save 10% on the total server cost Markwebuk Web Hosting 0 Apr 8th 2008 7:23 am
Script to save a file on the server vipmoney PHP 6 Aug 26th 2007 6:14 am
Save money when you buy online... webdesigner General Chat 9 Apr 20th 2007 1:12 pm
Scan a document, save to server SERPalert Programming 7 Mar 10th 2007 8:55 pm
How to save files on directly from server from some other sites ? poseidon Site & Server Administration 4 Apr 29th 2006 4:08 am


All times are GMT -8. The time now is 9:50 pm.