English 中文(简体)
多个文件上传( 数组) php
原标题:multiple file upload (array) php

< 强度 > PHPP 脚本

   $count = 0;
    foreach ($_FILES[ filesToUpload ] as $file) {
      //upload process
      echo $file[$count][ tmp_name ]. , ;
      $count ++;
    }

< 强 > HTML

<form method="POST" action="action-here" enctype="multipart/form-data">
<input class="btn" name="filesToUpload[]" type="file" multiple="" />
<input class="btn primary" type="submit" value="Submit">
</form>

我这样做大错特错。我试图做的是使它成为你选择的文件,然后php脚本像数组一样处理它?

我不断外出诸如 1,i,C, 的插件。

我知道其他方法 做多次上传, 但我知道这是最简单的方法之一。

最佳回答
foreach ($_FILES[ filesToUpload ][ error ] as $k => $error) {
  echo $_FILES[ filesToUpload ][ tmp_name ][$k]. , ;
}

提示: 用 print_r($_FILES) 调试它 。

问题回答

您应该写下 < a href=>" "http://www.php.net/ manual/ en/ faitares. file-upload. post- method.php" rel = "no follow" > this way :

echo $file[ tmp_name ][$count]. , ;




相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

image changed but appears the same in browser

I m writing a php script to crop an image. The script overwrites the old image with the new one, but when I reload the page (which is supposed to pickup the new image) I still see the old one. ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签