我有以下代码:
for($i=0; $i<count($_FILES['upload_obra']['name']); $i++) {
//Get the temp file path
$tmpFilePath = $_FILES['upload_obra']['tmp_name'][$i];
echo $tmpFilePath . " tmpFilePath";
//Make sure we have a filepath
if ($tmpFilePath != ""){
mkdir('images/fotos-geral/' . $ultimoID, 0700);
mkdir('images/fotos-geral/' . $ultimoID . '/obra', 0700);
$newFilePath = 'images/fotos-geral/' . $ultimoID . '/obra/' . $_FILES['upload_obra']['name'][$i];
if(move_uploaded_file($tmpFilePath, $newFilePath)) {
echo "rolou";
//Handle other code here
}
}
}
for($i=0; $i<count($_FILES['upload_doc']['name']); $i++) {
//Get the temp file path
$tmpFilePath = $_FILES['upload_doc']['tmp_name'][$i];
echo $tmpFilePath . " tmpFilePath";
//Make sure we have a filepath
if ($tmpFilePath != ""){
mkdir('images/fotos-geral/' . $ultimoID, 0700);
mkdir('images/fotos-geral/' . $ultimoID . '/doc', 0700);
$newFilePath = 'images/fotos-geral/' . $ultimoID . '/doc/' . $_FILES['upload_doc']['name'][$i];
if(move_uploaded_file($tmpFilePath, $newFilePath)) {
echo "rolou";
//Handle other code here
}
}
}
我的表单中存在两个图像上传。每一个都是一个上传特定的。但是,没有创建粘贴!上传不会发生。我已经选择了十张图片,但它不起作用。