Posted by Kim Andr Aker on 11/01/06 11:49
kirke wrote:
> [top posting fixed]
> Kim André Akerø wrote:
> > kirke wrote:
> >
> > > I want to save output file on server. (same folder)
> > > I have no idea how can I assign path.
> > > can i just use
> > >
> > > $book->saveas("/final.xls");
> >
> > Do you have any more sample code for this? Ie. what is the $book
> > variable?
>
> <?php
>
> $excel=new COM("Excel.Application") or Die ("Did not connect");
>
> $excel->sheetsinnewworkbook=1;
> $excel->Workbooks->Add();
>
> $book=$excel->Workbooks(1);
> $sheet=$book->Worksheets(1);
>
> $sheet->Name="Debug-Test";
> $book->saveas("/final.xls");
> ?>
>
> code is like this.
> what i want to know is, if i don't know exact path of directory where
> my index page is in, how can I set up saveas path?
In which case, it'll be something like this:
$book->saveas($_SERVER["DOCUMENT_ROOT"]."/final.xls");
--
Kim André Akerø
- kimandre@NOSPAMbetadome.com
(remove NOSPAM to contact me directly)
[Back to original message]
|