mztest / yii2-single-file-upload
Single file upload extension
Installs: 38
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
Type:yii2-extension
Requires
- blueimp/jquery-file-upload: *
- yiisoft/yii2: >=2.0.7
This package is not auto-updated.
Last update: 2025-03-27 03:55:46 UTC
README
Single file upload extension
This package is deprecated
This package is deprecated. All the features were integrated into mztest/yii2-widget-file-upload
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist mztest/yii2-single-file-upload "*"
or add
"mztest/yii2-single-file-upload": "*"
to the require section of your composer.json
file.
Usage
-
Define your web base url aliase '@frontendWeb'
Yii::setAlias('@frontendWeb', 'http://your.domain.com');
-
Set upload action at your controller
public function actions() { return [ 'upload' => [ 'class' => 'mztest\singleFileUpload\actions\SingleFileUploadAction', 'uploadFolder' => 'your relative upload folder name.', ], ]; }
-
simply use it in your code by :
<?= \mztest\singleFileUpload\SingelFileUpload::widget(); ?>
or
<?= $form->field($model, 'floor_image')->widget(SingleFileUpload::className(), [ 'uploadAction' => ['upload'] ]) ?>