Skip to content
Extension for Yii Framework, allows your users to easily upload files to your server without use Flash
JavaScript PHP
Latest commit bafbc5c Mar 13, 2013 @kosenka Update qqFileUploader.php
убраны лишние комментарии
Failed to load latest commit information.
assets update 2 May 25, 2012
EAjaxUpload.php update May 25, 2012
EAjaxUploadAction.php initial commit May 25, 2012
README.md Update README.md Mar 13, 2013
qqFileUploader.php Update qqFileUploader.php Mar 13, 2013

README.md

EAjaxUpload - Данное расширение для Yii Framework позволяет загружать файлы без использования Flash

Установка

  • Скачать (zip, tar.gz).

  • Распаковать архив в папку application.extensions.EAjaxUpload . Должно получиться следующее:

protected/
├── components/
├── controllers/
├── ... application directories
└── extensions/
    ├── EAjaxUpload/
    │   ├── assets/
    │   └── ... другие файлы расширения EAjaxUpload
    └── ... другие расширения

ССылки

Использование

В представлении/шаблоне прописать так:

<? $this->widget('ext.EAjaxUpload.EAjaxUpload',
                 array(
                       'id'=>'EAjaxUpload',
                       'config'=>array(
                                       'action'=>$this->createUrl('files/uploadByAjax'),
                                       'template'=>'<div class="qq-uploader"><div class="qq-upload-drop-area"><span>Drop files here to upload</span></div><div class="qq-upload-button">Upload a file</div><ul class="qq-upload-list"></ul></div>',
                                       'debug'=>false,
                                       'allowedExtensions'=>array('jpg'),
                                       'sizeLimit'=>10*1024*1024,// maximum file size in bytes
                                       'minSizeLimit'=>10*1024*1024,// minimum file size in bytes
                                       'onComplete'=>"js:function(id, fileName, responseJSON){ alert(fileName); }",                                       
                                       //'messages'=>array(
                                       //                  'typeError'=>"{file} has invalid extension. Only {extensions} are allowed.",
                                       //                  'sizeError'=>"{file} is too large, maximum file size is {sizeLimit}.",
                                       //                  'minSizeError'=>"{file} is too small, minimum file size is {minSizeLimit}.",
                                       //                  'emptyError'=>"{file} is empty, please select files again without it.",
                                       //                  'onLeave'=>"The files are being uploaded, if you leave now the upload will be cancelled."
                                       //                 ),
                                       //'showMessage'=>"js:function(message){ alert(message); }"
                                      )
                      )); ?>
Something went wrong with that request. Please try again.