假设表单如下:
<form action="xxx.php" method=post ENCTYPE="multipart/form-data">
<input type="file" name="csvfile">
<input type="submit" name="add" value="upload">
</form>
xxx.PHP程序这样写:
if(isset($csvfile) && $csvfile!="none" ){
unlink($csvfile);
}
<form action="xxx.php" method=post ENCTYPE="multipart/form-data">
<input type="file" name="csvfile">
<input type="submit" name="add" value="upload">
</form>
xxx.PHP程序这样写:
if(isset($csvfile) && $csvfile!="none" ){
unlink($csvfile);
}
php上传的文件是暂存在临时目录中的
在接收的php程序结束时会自动删掉,所以才需要用copy将它备份。如果你只是想删除文件,就用unlink()。
有语句么?