为什么thinkphp不能实现图片批量上传 你可以开发自己的,使用swfupload 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 这个也做到了吗?如果需要使用多个文件上传,只需要修改表单,把<input type=”file” name=”photo”>改为<input type=”file” name=”photo1”><input type=”file” name=”photo2”><input type=”file” name=”photo3”>或者<input type=”file” name=”photo[]”><input type=”file” name=”photo[]”><input type=”file” name=”photo[]”>两种方式的多附件上传系统的文件上传类都可以自动识别。 我知道那错了 好了 import("ORG.Net.UploadFile"); $upload = new UploadFile(); // 实例化上传类 $upload->maxSize = 2000000; // 设置附件上传大小 $upload->allowExts = array('jpg', 'gif', 'png', 'jpeg'); // 设置附件上传类型 $upload->savePath = './Public/Uploads/'; // 设置附件上传目录 // $upload->saveRule= time().rand(); if($upload->upload()) { echo "1"; }else{ echo "0"; } // $upload->saveRule= time().rand(); 这个屏蔽了就好了 但是不知道为什么? 请看博客http://blog.csdn.net/q279838089/article/details/8560938里面有详细说明 在我们的爱志汇网的时候,刚好也遇到这个问题,不过现在已经解决了,thinkphp3.1的上传类已支持多文件上传:foreach ($_FILES as $key=>$files){ if(!empty($files['name'])) { $res = $up->uploadOne($files); if($res){ // 保存附件信息 $_POST[$key] = $res ['savename']; }else{ // 上传错误 $this->error($up->getErrorMsg()); } } } 内容已被编辑! mysql 里实现查询汉字的拼音首字母 关于php上传文件的问题,大神赏赏眼看看错在哪!!! 如何判断登录? 为什么我用php可以将图片以二进制存到mysql,显示到web页面时却是红叉 如何用PHP获得浏览者真实的IP,用这些函数真能得到?大家试过? 文本留言第七问 数据库的表中字段太多,用insert into语句插入值,字符串超长,怎么办?? 如何在一个PHP里执行一条或者几条语句,让另一个php刷新??? 各位高手,能不能告诉我关于几个常用的session函数的用法??非常急!!在线等!! 跨页面读取数据库session失败 关于一次上传多个图片的插件有没有?
<input type=”file” name=”photo”>
改为
<input type=”file” name=”photo1”>
<input type=”file” name=”photo2”>
<input type=”file” name=”photo3”>
或者
<input type=”file” name=”photo[]”>
<input type=”file” name=”photo[]”>
<input type=”file” name=”photo[]”>
两种方式的多附件上传系统的文件上传类都可以自动识别。
import("ORG.Net.UploadFile");
$upload = new UploadFile(); // 实例化上传类
$upload->maxSize = 2000000; // 设置附件上传大小
$upload->allowExts = array('jpg', 'gif', 'png', 'jpeg'); // 设置附件上传类型
$upload->savePath = './Public/Uploads/'; // 设置附件上传目录
// $upload->saveRule= time().rand();
if($upload->upload())
{
echo "1";
}else{
echo "0";
}
// $upload->saveRule= time().rand(); 这个屏蔽了就好了 但是不知道为什么?
里面有详细说明
foreach ($_FILES as $key=>$files){
if(!empty($files['name'])) {
$res = $up->uploadOne($files);
if($res){ // 保存附件信息
$_POST[$key] = $res ['savename'];
}else{ // 上传错误
$this->error($up->getErrorMsg());
}
}
}