日期:2014-05-16 浏览次数:20683 次
<form name="frm" method="post" enctype="multipart/form-data">
<table>
......
<input id="myfile" name="myfile" type="file"/>
.......
</table>
</form>
function aa(){
document.forms[0].action='/Pfmg0420/upload';
document.forms[0].target='_blank';
document.forms[0].submit();
}
.....
$fileName = $_FILES["myfile"]["name"];
.....
<iframe name="ajaxifr" style="display:none"></iframe>
<form name="frm" method="post" enctype="multipart/form-data" target="ajaxifr">
<table>
......
<input id="myfile" name="myfile" type="file"/>
.......
</table>
</form>
$fileName = $_FILES["myfile"]["name"];
//保存文件操作
echo "<script>alert('上传完毕');parent.frm.reset()</script>"//输出js脚本提示信息并且重置表单