Anyone can tell my why it keeps saving at My Documents?

$newfile = 'temp.xls';


If I echo $newfile, it will display 'http://localhost/test/excel/temps.xls'

Its suppose to save it at same level right? wrong, it keeps saving at "My Documents"

How is that possible?


7 Years
Discussion Span
Last Post by yorro

have you try $newfile = 'C:/youre dir/temp.xls';

Won't that move the file to the client's computer?

//how about?

I have tried:

//how about?

Is it the same thing?


This is what I am trying to do.

1. User uploads an excel file(to TMP)
2. Get the file from TMP
3. Open the file as Excel
4. Fill the excel using data from mySQL
5. Save file to root directory(PROBLEM)
6. Create Download link

This is what I did as an alternative, ugly but it does the job.

1. Save excel file to "C:/"
2. Move file to root directory using Copy() and Unlink()
3. Create download link

Somewhere I would delete any processed excel file except the current file that is to be downloaded. This is to prevent Copy() from piling up too many files.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.