Yii获取上传文件的后缀名_PHP教程

WBOY
Release: 2016-07-13 09:48:14
Original
943 people have browsed it

Yii获取上传文件的后缀名

Yii获取上传文件的后缀名,主要是用CUploadedFile类中的getExtensionName()方法,例如:

image=CUploadedFile::getInstance($form->model, 'image'); $randName=date('Ymdhis').rand(100,999).'.'.$form->model->image->getExtensionName(); $form->model->image->saveAs(Yii::app()->basePath.'/../upload/'.$randName); ......
Copy after login

您可能感兴趣的文章

  • Yii framework框架之模块开发分析
  • Yii中的数据库事务的使用方法小结
  • Yii 动作方法技巧
  • fckeditor上传文件按日期存放及重命名上传文件的方法
  • yii框架目录结构详细分析说明
  • yii框架缓存知识总结
  • Yii控制器动作参数绑定处理
  • yii框架如何配置默认controller与action

www.bkjia.com true http://www.bkjia.com/PHPjc/1024332.html TechArticle Yii获取上传文件的后缀名 Yii获取上传文件的后缀名,主要是用CUploadedFile类中的getExtensionName()方法,例如: ?php......$form-image=CUploadedFile::ge...
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!