Download the PHP package yii-ext/plupload without Composer
On this page you can find all versions of the php package yii-ext/plupload. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download yii-ext/plupload
More information about yii-ext/plupload
Files in yii-ext/plupload
Download yii-ext/plupload
More information about yii-ext/plupload
Files in yii-ext/plupload
Vendor yii-ext
Package plupload
Short Description plupload wrapper
License
Homepage https://github.com/yii-ext/plupload/
Package plupload
Short Description plupload wrapper
License
Homepage https://github.com/yii-ext/plupload/
Please rate this library. Is it a good library?
Informations about the package plupload
/**
* @return array list of actions.
*/
public function actions()
{
return array(
'upload' => array(
'class' => '\yii-ext\plupload\Action',
'completeCallback' => function ($fileFullName, $fileSelfName) {
$fileModel = new UserFileModel();
$fileModel->userId = Yii::app()->user->id;
$fileModel->name = $fileSelfName;
$fileModel->file = $fileFullName;
if (!$fileModel->save()) {
throw new CHttpException(500, CVarDumper::dumpAsString($fileModel->getErrors()));
}
$response = array(
'downloadUrl' => Yii::app()->createUrl('downloadfile', array('id' => $fileModel->id)),
'deleteUrl' => Yii::app()->createUrl('deletefile', array('id' => $fileModel->id)),
);
return $response;
}
)
);
}
**
* Allow downloading of the user file specified by its id.
* @param integer $id user file id.
* @throws CHttpException on failure.
*/
public function actionDownloadfile($id)
{
$userFileModel = $this->loadUserFileModel($id);
Yii::app()->getRequest()->sendFile($userFileModel->getFileSelfName(), $userFileModel->getFileContent());
}
/**
* Deletes user file specified by its id.
* @param integer $id user file id.
* @throws CHttpException on failure.
*/
public function actionDeletefile($id)
{
$userFileModel = $this->loadUserFileModel($id);
$userFileModel->delete();
if (!Yii::app()->getRequest()->getIsAjaxRequest()) {
$this->redirect(array('resume'));
} else {
Yii::app()->end();
}
}
/**
* Finds the user file model specified by id.
* Checks if model belongs to the current user.
* @param integer $id user file id.
* @return UserFileModel|\zfort\db\ar\behaviors\File user file model instance.
* @throws CHttpException on failure.
*/
protected function loadUserFileModel($id)
{
/* @var UserFileModel|zfort\db\ar\behaviors\File $userFileModel */
/* @var WebUser $webUser */
$webUser = Yii::app()->getComponent('user');
$userFileModel = UserFileModel::model()->findByPk($id);
if (!is_object($userFileModel) || $userFileModel->userId != $webUser->getId()) {
throw new CHttpException(404, 'Unable to find requested file');
}
return $userFileModel;
}
All versions of plupload with dependencies
PHP Build Version
Package Version
No informations.
The package yii-ext/plupload contains the following files
Loading the files please wait ....