Commit 4b15c77a by Qiang Xue

Merge branch 'master' of git://github.com/yiisoft/yii2

parents b23bade2 6423c412
......@@ -80,6 +80,7 @@ Yii Framework 2 Change Log
- New #66: [Auth client library](https://github.com/yiisoft/yii2-authclient) OpenId, OAuth1, OAuth2 clients (klimov-paul)
- New #1393: [Codeception testing framework integration](https://github.com/yiisoft/yii2-codeception) (Ragazzo)
- New #1438: [MongoDB integration](https://github.com/yiisoft/yii2-mongodb) ActiveRecord and Query (klimov-paul)
- Enh #1839: Added support for getting file extension and basename from uploaded file (anfrantic)
2.0.0 alpha, December 1, 2013
---------------------------
......
......@@ -163,6 +163,22 @@ class UploadedFile extends Object
}
return false;
}
/**
* @return string original file base name
*/
public function getBaseName()
{
return pathinfo($this->name, PATHINFO_FILENAME);
}
/**
* @return string file extension
*/
public function getExtension()
{
return strtolower(pathinfo($this->name, PATHINFO_EXTENSION));
}
/**
* @return boolean whether there is an error with the uploaded file.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment