move_uploaded_file在PHP中不起作用。以下是代码
$TempFilePath ='../tmp';
$filename = $custid.$HTTP_POST_FILES['upload']['name'];
if(move_uploaded_file($HTTP_POST_FILES['upload']['tmp_name'], $setTempFilePath .$filename)){
echo '<br>File Moved <bR>';
if (file_exists($TempFilePath .$filename)){
echo '<br> File Exists <br>';
} else {
echo '<br> File doesnt Exists <br>';
}
else {
echo '<br>File not Moved <bR>';
}
输出为:
File Moved
File doesnt Exists
错误:如果文件被移动,那么为什么文件不存在。
终于想通了。https://bugs.php.net/bug.php?id=32644(您知道Apache执行内部'cwd/'吗?)