本文整理汇总了PHP中qqFileUploader::handleUploadRadio方法的典型用法代码示例。如果您正苦于以下问题:PHP qqFileUploader::handleUploadRadio方法的具体用法?PHP qqFileUploader::handleUploadRadio怎么用?PHP qqFileUploader::handleUploadRadio使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类qqFileUploader
的用法示例。
在下文中一共展示了qqFileUploader::handleUploadRadio方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionUploadAvartar
public function actionUploadAvartar()
{
$id = Yii::app()->request->getParam('id', 0);
$type = Yii::app()->request->getParam('type', 'channel');
if ($type == 'genre') {
$pathUpload = self::_PATH_ICONS_UPLOAD . "genre" . DS;
} elseif ($type == 'collection') {
$pathUpload = self::_PATH_ICONS_UPLOAD . "collection" . DS;
} elseif ($type == 'playlist') {
$pathUpload = self::_PATH_ICONS_UPLOAD . "playlist" . DS;
} elseif ($type == 'album') {
$pathUpload = self::_PATH_ICONS_UPLOAD . "album" . DS;
} else {
$pathUpload = self::_PATH_ICONS_UPLOAD . "channel" . DS;
}
Yii::import("ext.EAjaxUpload.qqFileUploader");
$allowedExtensions = array("png");
//array("jpg","jpeg","gif","exe","mov" and etc...
$sizeLimit = 100 * 1024 * 1024;
// maximum file size in bytes
$uploader = new qqFileUploader($allowedExtensions, $sizeLimit);
$result = $uploader->handleUploadRadio($pathUpload, $id);
if ($result['success']) {
$result['data'] = self::_URL_ICONS_RADIO . $type . '/' . $result['filename'];
} else {
$result['data'] = '';
}
echo CJSON::encode($result);
}