Pear and excel

I use pear to create excel files (with cakephp) and I want to send it as attachment.
So I want to save it to the server.
How can I do that?

$workbook =
 new Spreadsheet_Excel_Writer(time().'machine.xls');

The time().‘machine.xls’ is not saving at the server

I managed to solve it

$workbook = new Spreadsheet_Excel_Writer($file);