Yii gets the suffix name of the uploaded file _php tutorial

Source: Internet
Author: User
Tags yii

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 ...

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.