save as and save location

Dec 29, 2012 at 10:02 AM

Hi guys, I wanna ask how to save as the docx file with my own file name? instead of $objWriter->save('document.docx');

and how to set the generated docx location? such as my desktop..

thanks! :)

Jan 20, 2013 at 9:13 PM

File name: Change 'document.docx' to whatever you want to name the file;

Location: Do you mean server side or client side? Server side: just enter the document name with path as the argument to save, e.g. save('examples/mydocument.docx') - you need to be aware of the restrictions your server (e.g. apache) and its php setup will place on this in order to maintain the security of your server. Client side: you would probably use header() to prompt someone to save a document somewhere on their computer - you will have no control of the location though.