0

我有以下代码:

            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

            }
          }
        }

我的表单中存在两个图像上传。每一个都是一个上传特定的。但是,没有创建粘贴!上传不会发生。我已经选择了十张图片,但它不起作用。

4

1 回答 1

0

您确定要在您的 html 表单中使用吗?

 <form enctype="multipart/form-data"> </form>
于 2013-10-04T19:58:25.703 回答