Superman007
2016-09-30 21:51
require_once 'upload.class.php'; $upload = new upload(); $dest = $upload->uploadFile('myFile');
<?php header('Content-Type:text/html;Charset=utf-8'); require_once 'upload.class.php'; $uploadFiles = new upload(); //多文件,处理成单文件结构 $files = $uploadFiles->getFiles($_FILES); $uploadFiles->debug($files, '$files'); echo '---------------------------------------------'; //循环上传 foreach ($files as $file) { $uploadFiles = new upload(); $res = $uploadFiles->uploadFile(); $uploadFiles[] = $res; }
<form action="doAction.php" method="post" enctype="multipart/form-data"> <!--限制上传文件的大小,可以通过网页审查元素,绕过此限制--> <!-- <input type="hidden" name="MAX_FILE_SIZE" value='176942'/>--> 请选择您要上传的文件:<input type="file" name='myFile[]'/><br> 请选择您要上传的文件:<input type="file" name='myFile[]'/><br> 请选择您要上传的文件:<input type="file" name='myFile[]'/><br> 请选择您要上传的文件:<input type="file" name='myFile[]' multiple="multiple"/><br> <!--限制类型--> <!-- <input type="file" name="myFile" accept="image/jpeg,image/gif,image/png"/><br/>--> <input type="submit" value="上传文件"/> </form>
这个是我的html部分,试了好几种
PHP实现文件上传与下载
43735 学习 · 328 问题
相似问题