HTML表单多文件上传

2012-7-19 foooy PHP

单文件上传:

<form id="batchImportForm" method="post" enctype="multipart/form-data">
       <input type="file" id="file" name="file"/>
       <input type="submit" value="Send">
</form> 

多文件上传:

<form method="post" action="upload.php" enctype="multipart/form-data">
    <input name='uploads[]' type="file" multiple>
    <input type="submit" value="Send">
</form>

php接收示例:

foreach ($_FILES['uploads']['name'] as $filename) {
    echo $filename . '<br>';
}


标签: php 文件上传 html

评论(0) 浏览(6128)

Powered by emlog 鄂ICP备14000186号-1 sitemap