![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
文件上传
大明湖畔黑熊怪丶
这个作者很懒,什么都没留下…
展开
-
上传-----文件名称的替换
public function newName($name){ //获取文件后缀名 $extension = substr($name,strrpos($name,".")); //当前时间转化为毫秒----microtime $md5 = md5(microtime().rand(10000,1000000)); $fileName="./Up...原创 2018-03-13 19:38:17 · 517 阅读 · 0 评论 -
yii2框架中上传单(多)文件
1、单个文件上传首先建立一个模型models/UploadForm.php,内容如下namespace app\models; use yii\base\Model; use yii\web\UploadedFile; /** * UploadForm is the model behind the upload form. */ class UploadForm extends Mode...转载 2018-03-13 16:45:14 · 1255 阅读 · 0 评论