Yii gets the suffix name of the uploaded file
Yii gets the suffix name of the uploaded file, mainly using the Getextensionname () method in the Cuploadedfile class, for example:
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);..
Articles you may be interested in
- Analysis of module development of YII Framework Framework
- Summary of usage methods of database transactions in Yii
- Yii Action Method Tips
- FCKeditor upload file by date and rename upload file method
- Yii Framework directory structure detailed analysis description
- Summary of YII Framework cache knowledge
- The action parameter binding processing of YII controller
- How the YII framework configures the default controller and action
http://www.bkjia.com/PHPjc/1024332.html www.bkjia.com true http://www.bkjia.com/PHPjc/1024332.html techarticle Yii Gets the suffix name of the uploaded file Yii gets the suffix name of the uploaded file, mainly using the Getextensionname () method in the Cuploadedfile class, such as: Php ... $form-image=cuploadedfile :: ge ...