发布网友
共3个回答
热心网友
参考如下:
<?php
print_r($_FILES);
?>
<form method="POST" enctype="multipart/form-data">
<input type=file name=file[] /><br>
<input type=file name=file[] /><br>
<input type=file name=file[] /><br>
<input type=submit>
</form>
提交后 $_FILES 数组
Array
(
[file] => Array
(
[name] => Array
(
[0] => i.jpg
[1] => Ico.zip
[2] =>
)
[type] => Array
(
[0] => image/pjpeg
[1] => application/x-zip-compressed
[2] =>
)
[tmp_name] => Array
(
[0] => C:\Documents and Settings\Administrator\Local Settings\Temp\php188.tmp
[1] => C:\Documents and Settings\Administrator\Local Settings\Temp\php1.tmp
[2] =>
)
[error] => Array
(
[0] => 0
[1] => 0
[2] => 4
)
[size] => Array
(
[0] => 7198
[1] => 121062
[2] => 0
)
)
)
热心网友
我所知目前有三种方式可以实现你的要求:
基于iframe,无进度显示,不推荐。记得有个国外的dhtmlx框架里有个多文件upload组件
基于flash,多文件,可以显示上传进度。这个常用的就是swfupload和其衍生版jquery.uploadify
基于html5,多文件,可以显示上传进度。如果你的目标浏览器支持的话推荐使用,使用html5的file/file reader API即可实现纯Html+js的多文件可视进度上传
热心网友
jquery.uploadify,这个可以研究一下。 ~~葛皖松~~