Yii gets the suffix name of the uploaded file_PHP tutorial
Jul 13, 2016 am 09:48 AMYii 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:
<?php ...... $form->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
- Yii framework module development analysis
- Summary of how to use database transactions in Yii
- Yii Action method skills
- How to store and rename uploaded files by date in fckeditor uploaded files
- Detailed analysis and explanation of yii framework directory structure
- Yii framework cache knowledge summary
- Yii controller action parameter binding processing
- How to configure the default controller and action in the yii framework

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

How to transfer files from Quark Cloud Disk to Baidu Cloud Disk?

What to do if the 0x80004005 error code appears. The editor will teach you how to solve the 0x80004005 error code.

What is hiberfil.sys file? Can hiberfil.sys be deleted?

Different uses of slashes and backslashes in file paths

Simple steps to upload your own music on Kugou

Detailed explanation of log viewing command in Linux system!

Detailed explanation of the role of .ibd files in MySQL and related precautions
