save file on server

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • kirke

    save file on server

    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");

    Thx.

  • Kim André Akerø

    #2
    Re: save file on server

    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?

    --
    Kim André Akerø
    - kimandre@NOSPAM betadome.com
    (remove NOSPAM to contact me directly)

    Comment

    • kirke

      #3
      Re: save file on server

      <?php

      $excel=new COM("Excel.Appl ication") or Die ("Did not connect");

      $excel->sheetsinnewwor kbook=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?




      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?
      >
      --
      Kim André Akerø
      - kimandre@NOSPAM betadome.com
      (remove NOSPAM to contact me directly)

      Comment

      • Kim André Akerø

        #4
        Re: save file on server

        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.Appl ication") or Die ("Did not connect");
        >
        $excel->sheetsinnewwor kbook=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($_SERVE R["DOCUMENT_R OOT"]."/final.xls");

        --
        Kim André Akerø
        - kimandre@NOSPAM betadome.com
        (remove NOSPAM to contact me directly)

        Comment

        Working...