本文整理匯總了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);
}