I need to change the path of the file to be saved. Please help me.
$filename = "All Reports";
header("Content-type: application/octet-stream");
header("Content-Disposition: attachment; filename=" . $filename . ".xls");
header("Pragma: no-cache");
header("Expires: 0");
You cannot tell the browser which directory (path) to use in order to save the file.
If you could do that it means that you have access to the user's data and its a security risk.