如何在自定义或特定文件夹中存储或保存Excel文件?我有工作代码和代码工作,但唯一的问题是,我不能存储特定文件夹中的Excel文件?
主页
<form action="itemexcel.php" method="post"
onsubmit='$("#datatodisplay").val( $("<div>")
.append( $("#ReportTable").eq(0).clone() ).html() )'>
<table id="ReportTable" width="781" border="2"> Or <div id id="ReportTable">
<tr>
<td><input type="hidden" id="datatodisplay" name="datatodisplay"></td>
<td><input class="bg" type="submit" value="Export To Excel"></td>
</tr></table></div>
<input type="hidden" id="datatodisplay" name="datatodisplay">
<input class="bg" type="submit" value="Export To Excel">
itemexcel Page
<?php
$path = "/excelreports";
$file=$path."productexcel.xls";
header('Content-Type: application/force-download');
header('Content-disposition: attachment; filename=".$file."');
// Fix for crappy IE bug in download.
header("Pragma: ");
header("Cache-Control: ");
echo $_REQUEST['datatodisplay'];
?>