我有一个可用于将表单导出到excel文件的代码?现在一切正常,并将excel文件下载到下载文件夹,但问题是i want to store excel file into the localhost Excelfiles folder?
exporttoexcel.php
<?php
header('Content-Type: application/force-download');
header('Content-disposition: attachment; filename=customers.xls');
// Fix for crappy IE bug in download.
header("Pragma: ");
header("Cache-Control: ");
echo $_REQUEST['datatodisplay'];
?>
test.php的
<form action="exporttoexcel.php" method="post"
onsubmit='$("#datatodisplay").val( $("<div>")
.append( $("#ReportTable").eq(0).clone() ).html() )'>
<table id="ReportTable" width="781" border="2">
<tr><td><input type="text" name="test" id="test"></td>
<td><input type="text" name="test2" id="test2"></td>
</table></form>
答案 0 :(得分:0)
您无法在用户的计算机上指定文件下载的位置。