搜索$rule = $this->saveName;这一行改成这样,还重复你找我
$rule = md5($this->saveName.uniqid());
如果害怕重复,再定义一个guid,不知道怎么回事,我用phpstudy无法使用系统自带的guid生成方法,自定义guid如下
//guid生成--------------------------------------------------------
function guid()
{
if (function_exists('com_create_guid'))
{
return com_create_guid();
}
else
{
mt_srand((double)microtime()*10000);//optional for php 4.2.0 and up.
$charid = strtoupper(md5(uniqid(rand(), true)));
$hyphen = chr(45);// "-"
$uuid = //chr(123).// "{"
substr($charid, 0, 8)//.$hyphen
.substr($charid, 8, 4)//.$hyphen
.substr($charid,12, 4)//.$hyphen
.substr($charid,16, 4)//.$hyphen
.substr($charid,20,12);
//.chr(125);// "}"
return $uuid;
}
}
//guid生成--------------------------------------------------------
真是无语了,无语的无,无语的语,那个手册上对上传这一块的描述太模糊了,那个自定义函数都不知道在哪弄,在里面弄了还是重复,哎。。希望后来人能用到
框架的文件就是\ThinkPHP\Library\Think\upload.class.php
1.jpg
( 38.01 KB 下载:67 次 )
最佳答案