【发布时间】:2017-02-10 12:49:46
【问题描述】:
警告:move_uploaded_file(/images/24_silver_2_1.jpg):打开失败 流:中没有这样的文件或目录 C:\Inetpub\vhosts\leojungen.com\httpdocs\launch-complaint.php 上线 72
警告:move_uploaded_file():无法移动 'C:\Windows\Temp\php19A2.tmp' 到 '/images/24_silver_2_1.jpg' 中 C:\Inetpub\vhosts\leojungen.com\httpdocs\launch-complaint.php 上线 72
function uploadMultipleFiles($complaintId){
global $_pdo;$path = '';
// Count # of uploaded files in array
$total = count($_FILES['files']['name']);
// Loop through each file
for($i=0; $i<$total; $i++) {
//Get the temp file path
$tmpFilePath = $_FILES['files']['tmp_name'][$i];
//Make sure we have a filepath
if ($tmpFilePath != ""){
//Setup our new file path
$newFilePath = "/images/".$complaintId."_".$_FILES['files']['name'][$i];
//Upload the file into the temp dir
//echo "path: "; print_r($_SERVER);exit;
move_uploaded_file($tmpFilePath,$newFilePath);
}
$path .= $complaintId."_".$_FILES['files']['name'][$i]."^";
}
}
在我的本地环境中,所有文件都可以正常工作,但是当我将其实时部署时,它无法正常工作。
【问题讨论】:
标签: php file-upload cpanel plesk