javascript html5 多张图片上传
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/13429559/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Multi-upload images by html5
提问by jennifer Jolie
How can multi-upload images by html5
and js
and php
, Please give me a demo or example?
怎么可以通过html5
and 和js
and多上传图片,php
请给个demo或者例子?
Without using a plugin
不使用插件
I try as this code in html and selected multi image:
我尝试在 html 中使用此代码并选择多图像:
<input type="file" name="upload[]" multiple="multiple">
But i give in php code just one image:
但我在 php 代码中只给出了一张图片:
foreach( $_FILES['upload'] as $key => $all ){
foreach( $all as $i => $val ){
$new[$i][$key] = $val;
}
}
echo '<pre>';
print_r($new);
What do i do?
我该怎么办?
回答by Kathiravan
File upload with multiple file selection, drag&drop support, progress bars and preview images. File Upload Example
具有多个文件选择、拖放支持、进度条和预览图像的文件上传。 文件上传示例