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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-26 18:45:06  来源:igfitidea点击:

Multi-upload images by html5

phpjavascriptjqueryhtml

提问by jennifer Jolie

How can multi-upload images by html5and jsand php, Please give me a demo or example?

怎么可以通过html5and 和jsand多上传图片,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 Kimpo

Pluploadis a really good file uploader

Plupload是一个非常好的文件上传器

回答by Kathiravan

File upload with multiple file selection, drag&drop support, progress bars and preview images. File Upload Example

具有多个文件选择、拖放支持、进度条和预览图像的文件上传。 文件上传示例