[Extension] Xupload

hello …

After much reading in this forum and disarm the extension, I can say that is very good.

What I can not understand is why this code does not work




$this->widget('xupload.XUpload', array(

    'url' => Yii::app()->createUrl("site/upload"),

    'model' => $model,

    'attribute' => 'file',

    'multiple' => false,

    'htmlOptions' => array('id'=>'upload-form'),

));

and this worked out great




$this->widget('xupload.XUpload', array(

    'url' => Yii::app()->createUrl("site/upload"),

    'model' => $model,

    'showForm'=> true,

    'attribute' => 'file',

    'multiple' => false,

    'htmlOptions' => array('id'=>'upload-form'),

));

just a page I call the extension and I got to put the variable $ ShowForm = true

that would work.

I have version 0.5 with yii-booster

I just uploaded v0.5.1 that defaults $showForm to true, so that it has the original behavior, thanks!

Hi I just installed your plugin and it was good but my files are not upload , writes Error Empty file upload result, and when I do in XUploadAction var_dump ($ model) return Null ,I attach the code of form and controller upload

form


<?php

/* @var $this PersonalController */


$this->pageTitle = Yii::app()->name;

?>

<?php

$baseUrl = Yii::app()->baseUrl;

$cs = Yii::app()->getClientScript();

$cs->registerScriptFile($baseUrl . '/js/jquery.placeholder.min.js');

$cs->registerScriptFile($baseUrl . '/js/address.js');

$cs->registerScriptFile($baseUrl . '/js/personal_form.js');

$cs->registerScriptFile($baseUrl . '/js/jquery.maskedinput.js');

$cs->registerScriptFile($baseUrl . '/js/phone.js');

$cs->registerScriptFile($baseUrl . '/js/jquery.tooltip.js');

$cs->registerScriptFile($baseUrl . '/js/tooltip.settings.js');




//$cs->registerCssFile($baseUrl . '/js/uploadify/uploadify.css');

?>


<?php if (Yii::app()->user->hasFlash('personal')): ?>


    <div class="flash-success">

        <?php echo Yii::app()->user->getFlash('personal'); ?>

    </div>


<?php endif; ?>




<div id="personal-info">

    <div class="form">


        <?php

        $form = $this->beginWidget('CActiveForm', array(

            'id' => 'personal-form',

                //'enableClientValidation' => true,

                //'enableAjaxValidation'=>true,

                /* 'clientOptions' => array(

                  'validateOnSubmit' => true,

                  'afterValidate' => 'js:function(form, data, hasError) { alert("asdasdasd"); return true;}'

                  ), */

            'htmlOptions'=>array('enctype'=>'multipart/form-data'),

                ));

        $category = 'personal_translate';

        ?>


        <?php echo $form->errorSummary($model); ?>

        <div id="message_block"></div>

        <div id ="error_block"></div>


        <?php $this->beginWidget('system.web.widgets.CClipWidget', array('id' => 'Паспортные данные')); ?>

        <div>Поля, отмеченные <span class="required">*</span> обязательны для заполнения.</div>

        <div class="form-row">

            <div class="row">

                <?php //echo  ?>

                <div class="required">*</div>

                <?php echo $form->textField($model, 'firstname', array('placeholder' => $model->getAttributeLabel('firstname'))); ?>

                <?php echo $form->error($model, 'firstname'); ?>

            </div>

            <div class="row">

                <div class="required">*</div>

                <?php echo $form->textField($model, 'lastname', array('placeholder' => $model->getAttributeLabel('lastname'))); ?>

                <?php echo $form->error($model, 'lastname'); ?>

            </div>

            <div class="row">

                <?php echo $form->textField($model, 'middleInitial', array('placeholder' => $model->getAttributeLabel('middleInitial'))); ?>

                <?php echo $form->error($model, 'middleInitial'); ?>

            </div>

        </div>

        <div class="form-row">

            <div class="row">

                <div class="required">*</div>

                <?php //echo $form->labelEx($model, Yii::t($category, 'sex')); ?>

                <?php echo $form->dropDownList($model, 'sex', $model->getSexes(), array('prompt' => Yii::t($category, 'Не выбран'))); ?>

                <?php echo $form->error($model, 'sex'); ?>

            </div>

            <div class="row">

                <div class="required">*</div>

                <?php //echo $form->labelEx($model, Yii::t($category, 'citizenshipid')); ?>

                <?php echo $form->dropDownList($model, 'citizenshipid', $model->getCityzenships(), array('prompt' => Yii::t($category, 'Не выбран'))); ?>

                <?php echo $form->error($model, 'citizenshipid'); ?>

            </div>

            <div class="row">

                <div class="required">*</div>

                <?php //echo $form->labelEx($model, 'birthday'); ?>

                <?php

                $this->widget('zii.widgets.jui.CJuiDatePicker', array(

                    'model' => $model,

                    'attribute' => 'birthday',

                    'htmlOptions' => array(

                        'placeholder' => $model->getAttributeLabel('birthday'),

                        )));

                ?>

                <?php echo $form->error($model, 'birthday'); ?>


            </div>

        </div>

        <div class="form-row">

            <div class="row">

                <div class="required">*</div>

                <?php //echo $form->labelEx($model, 'doctypeid'); ?>

                <?php echo $form->dropDownList($model, 'doctypeid', $data['doctypes'], array('prompt' => Yii::t($category, 'Не выбран'))); ?>

                <?php echo $form->error($model, 'doctypeid'); ?>


            </div>

        </div>

        <div class="form-row">

            <div class="row">

                <div class="required">*</div>

                <?php //echo $form->labelEx($model, Yii::t($category, 'requisites')); ?>

                <?php echo $form->textField($model, 'requisites', array('placeholder' => $model->getAttributeLabel('requisites'))); ?>

                <?php echo $form->error($model, 'requisites'); ?>


            </div>

            <div class="row">

                <div class="required">*</div>

                <?php //echo $form->labelEx($model, Yii::t($category, 'issuedBy')); ?>

                <?php echo $form->textField($model, 'issuedBy', array('placeholder' => $model->getAttributeLabel('issuedBy'))); ?>

                <?php echo $form->error($model, 'issuedBy'); ?>


            </div>

            <div class="row">

                <div class="required">*</div>

                <?php //echo $form->labelEx($model, Yii::t($category, 'issuedWhen')); ?>

                <?php

                $this->widget('zii.widgets.jui.CJuiDatePicker', array(

                    'model' => $model,

                    'attribute' => 'issuedWhen',

                    'htmlOptions' => array(

                        'placeholder' => $model->getAttributeLabel('issuedWhen')

                    ),

                    'options' => array(

                        'changeMonth' => 'true',

                        'changeYear' => 'true',

                    ),

                ));

                ?>

                <?php echo $form->error($model, 'issuedWhen'); ?>


            </div>

        </div>

        <div class="form-row">

            <div class="row">

                <?php echo CHtml::textField('regaddress_text', $this->GetAddressStringByAddressId($model->regaddressid)/* 'sdf' */, array('placeholder' => $model->getAttributeLabel('addresstext'))); ?>

                <?php echo $form->hiddenField($model, 'regaddressid'); ?>

                <?php echo $form->error($model, 'regaddressid'); ?>


            </div>

        </div>

        <div class="row">

            <!--><div id="scans_block">

                <?php

                $this->widget('application.components.widgets.ScansBlock', array('type' => 'passport', 'name' => 'Страница паспорта'));

                ?>

            </div>

        </div>

            <?var_dump($model);?>

        <!--><div class="form-row">

            <div class="row">

                <?

                

 $this->widget('xupload.XUpload', array(

                    'url' => Yii::app()->createUrl("scans/upload"),

                    'model' => $model,

                    'attribute' => 'file',

                    'multiple' => false,

                    //'showForm'=> true,

                    'htmlOptions'=> array ('id' => 'personal-form'),

));




        ?>        

           <!--> </div>

        </div><--!>




        <div class="row buttons">

            <?php echo CHtml::submitButton('Далее>>', array('id' => 'passport_data', 'name' => 'passport_data')); ?>

        </div>

        <?php $this->endWidget(); ?>


  

        <?php $this->beginWidget('system.web.widgets.CClipWidget', array('id' => 'Контактные данные')); ?>

        <div>Поля, отмеченные <span class="required">*</span> обязательны для заполнения.</div>

        <div class="form-row factaddress">

            <div class="row">

                <?php echo CHtml::textField('factaddress_text', $this->GetAddressStringByAddressId($model->factaddressid)/* 'sdf' */, array('placeholder' => $model->getAttributeLabel('factaddressid'))); ?>

                <?php echo $form->hiddenField($model, 'factaddressid'); ?>

                <?php echo $form->error($model, 'factaddressid'); ?>


            </div>


        </div>

        <?php if (empty($model->factaddressid)): ?>

            <div class="sameaddr">

                <?php //echo $form->activeCheckBox($model,'sameaddr',array()); 

                ?>

                <?php echo $form->checkBox($model, 'same_address') . ' Совпадает с адресом регистрации'; ?>

            </div>

        <?php endif; ?>


        <div class="form-row phone-row">

            <div class="row">

                <div class="required">*</div>

                <?php //echo $form->labelEx($model, Yii::t($category, 'issuedBy')); ?>

                <?php echo $form->textField($model, 'phone1', array('placeholder' => $model->getAttributeLabel('phone1'), 'class' => 'phone')); ?>

                <?php echo $form->error($model, 'phone1'); ?>

                <div class="phone_example">Например: + 44 (011) 111-11-11</div>

            </div>

            <div class="row">


                <?php //echo $form->labelEx($model, Yii::t($category, 'issuedBy')); ?>

                <?php echo $form->textField($model, 'phone3', array('placeholder' => $model->getAttributeLabel('phone3'), 'class' => 'phone')); ?>

                <?php echo $form->error($model, 'phone3'); ?>

                <div class="phone_example">Например: + 44 (011) 111-11-11</div>

            </div>

        </div>

        <div class="form-row phone-row">

            <div class="row">


                <?php //echo $form->labelEx($model, Yii::t($category, 'issuedBy')); ?>

                <?php echo $form->textField($model, 'phone2', array('placeholder' => $model->getAttributeLabel('phone2'), 'class' => 'phone')); ?>

                <?php echo $form->error($model, 'phone2'); ?>

                <div class="phone_example">Например: + 44 (011) 111-11-11</div>

            </div>

            <div class="row">


                <?php //echo $form->labelEx($model, Yii::t($category, 'issuedBy')); ?>

                <?php echo $form->textField($model, 'phone4', array('placeholder' => $model->getAttributeLabel('phone4'), 'class' => 'phone')); ?>

                <?php echo $form->error($model, 'phone4'); ?>

                <div class="phone_example">Например: + 44 (011) 111-11-11</div>

            </div>

        </div>

        <div class="form-row">

            <div class="row">

                <div class="required">*</div>

                <?php //echo $form->labelEx($model, Yii::t($category, 'issuedBy')); ?>

                <?php echo $form->textField($model, 'email', array('placeholder' => $model->getAttributeLabel('email'))); ?>

                <?php echo $form->error($model, 'email'); ?>

            </div>

        </div>

        <div class="form-row">

            <div class="row buttons">

                <?php echo CHtml::submitButton('<<Назад', array('id' => 'contact_data_back', 'name' => 'contact_data_back')); ?>

            </div>

            <div class="row buttons">

                <?php echo CHtml::submitButton('Cохранить', array('id' => 'contact_data_next', 'name' => 'contact_data_next')); ?>

            </div>

        </div>

        <?php $this->endWidget(); ?>


        <?php// $this->beginWidget('system.web.widgets.CClipWidget', array('id' => 'Дополнительная информация')); ?>

        <div class="row">

            <?php// echo $form->labelEx($model, 'comment'); ?>

            <?php //echo $form->textArea($model, 'comment'); ?>


        </div>

        <div class="row">

            <?php //echo $form->labelEx($model, 'has_alpa_consulter'); ?>

            <?php //echo $form->checkBox($model, 'has_alpa_consulter'); ?>

            <?php// echo $form->radioButtonList($model,'hasAlpaConsulter', array('0' => 'Я буду вести переговоры самостоятельно', '1' => 'Переговоры будет вести мой уполномоченный представитель'), array('separator' => '')); ?>

            </div>

        <div class="form-row">




            <div class="row buttons">

                <?php// echo CHtml::submitButton('<<Назад', array('name' => 'additional_info_back')); ?>

            </div>

            <div class="row buttons">

                <?php// echo CHtml::submitButton('Сохранить', array('name' => 'additional_info')); ?>

            </div>

        </div>

        <?php //$this->endWidget(); ?>


        <?php

        $tabParameters = array();

        foreach ($this->clips as $key => $clip)

            $tabParameters['tab' . (count($tabParameters) + 1)] = array('title' => $key, 'content' => $clip);

        ?>


        <?php

        $this->widget('system.web.widgets.CTabView', array(

            'tabs' => $tabParameters,

            'cssFile' => 'css/tabs.css'));

        ?>
















        <?php

        echo CHtml::hiddenField('submit_name', '');

        ?>




        <?php $this->endWidget(); ?>

        <?php $this->widget('application.components.widgets.AddressForm'); ?>

    </div>

</div>

<?php d($model); ?>

<?php d(Yii::app()->user); ?>



uploadController


class ScansController extends Controller {

     public function actions()

    {

        return array(

            'upload'=>array(

                'class'=>'xupload.actions.XUploadAction',

                'path' =>Yii::app() -> getBasePath() . "/uploads",

                'publicPath' => Yii::app() -> getBaseUrl() . "/uploads",

            ),

        );

    }



An obvious question would be, are you passing a $model variable to your view?

Yes, I’m a little altered controller and post the answer shows


lass ScansController extends Controller {

    public function actionIndex() {

        Yii::import("xupload.models.XUploadForm");

        $model = new XUploadForm;

        $this -> render('p-form', array('model' => $model, ));

    }

 

     public function actions()

    {

        return array(

            'upload'=>array(

                'class'=>'xupload.actions.XUploadAction',

                'path' =>Yii::app() -> getBasePath() . "/uploads",

                'publicPath' => Yii::app() -> getBaseUrl() . "/uploads",

            ),

        );

    }

and my post


-----------------------------17679742877726586041559880 Content-Disposition: form-data; name="PersonalForm[firstname]" -----------------------------17679742877726586041559880 Content-Disposition: form-data; name="PersonalForm[lastname]" test -----------------------------17679742877726586041559880 Content-Disposition: form-data; name="PersonalForm[middleInitial]" test -----------------------------17679742877726586041559880 Content-Disposition: form-data; name="PersonalForm[sex]" 0 -----------------------------17679742877726586041559880 Content-Disposition: form-data; name="PersonalForm[citizenshipid]" 11 -----------------------------17679742877726586041559880 Content-Disposition: form-data; name="PersonalForm[birthday]" 09/17/2012 -----------------------------17679742877726586041559880 Content-Disposition: form-data; name="PersonalForm[doctypeid]" 1 -----------------------------17679742877726586041559880 Content-Disposition: form-data; name="PersonalForm[requisites]" 1231231321321 -----------------------------17679742877726586041559880 Content-Disposition: form-data; name="PersonalForm[issuedBy]" 32423423 -----------------------------17679742877726586041559880 Content-Disposition: form-data; name="PersonalForm[issuedWhen]" 09/26/2012 -----------------------------17679742877726586041559880 Content-Disposition: form-data; name="regaddress_text" 123456, Россия, г. Санкт-Петербург, ул. Маыа д.1234 -----------------------------17679742877726586041559880 Content-Disposition: form-data; name="PersonalForm[regaddressid]" 2486 -----------------------------17679742877726586041559880 Content-Disposition: form-data; name="factaddress_text" 123456, Россия, г. Санкт-Петербург, ул. Маыа д.123 -----------------------------17679742877726586041559880 Content-Disposition: form-data; name="PersonalForm[factaddressid]" 2487 -----------------------------17679742877726586041559880 Content-Disposition: form-data; name="PersonalForm[phone1]" -----------------------------17679742877726586041559880 Content-Disposition: form-data; name="PersonalForm[phone3]" -----------------------------17679742877726586041559880 Content-Disposition: form-data; name="PersonalForm[phone2]" -----------------------------17679742877726586041559880 Content-Disposition: form-data; name="PersonalForm[phone4]" -----------------------------17679742877726586041559880 Content-Disposition: form-data; name="PersonalForm[email]" terrner@ya.ru -----------------------------17679742877726586041559880 Content-Disposition: form-data; name="submit_name" -----------------------------17679742877726586041559880 Content-Disposition: form-data; name="PersonalForm[file]"; filename="dEc4_oIZ-z4.jpg" Content-Type: image/jpeg ÿØÿà�JFIF��H�H��ÿÛ�C� a    eeeeÿÛ�CaaÿÀ�Å\"�ÿÄ�������������a ÿÄ�T�a�!1A"Qaaq2#B‘¡Rb±ÁÑ$3áðr 4C‚ñDSd„Ó(6Tsƒ’“”•¥²ÂÃÒÿÄ��������������ÿÄ�)������!1"AQ2aqB#3RÿÚ���?�øŠ(® QE�QEEPQ@ÃÐ×h ejJÛÈîQ»�I 3€:šg–¬ÈIBA#aaŒXE–#Œ{ÑPÚ]€¢Š(šhQVPLQGQIaM@Epg?Ú²€¢Š*Ø0QEd–:ET€¢€sҊ�¢Š(´€QE;ošhã.±‡`»Û¢ç¹ø ¢žº„[\K‘&TbD9VÁÆGÅ"@€þ蒿#š„Óè<œÑE (¢º§ŽÆ€n'°Oµ.UÃ7˜Ä¾2ñS}óÀ?qžq@QEU;EU€QEØz(íŠ(� ÁÆzÑEEPQ@QE�QEq¸ ¤ÑHÉ÷£'Þ£ .ŠFO½>õVìjMÍ`(¢Š€QE�QE”QElŠ(  (¢‰ØiL»H•¸Ïš) QELb¬QS%ºEtzR„yïÛ?¥ZhÁ=(ÁiN “ƒ]^‡ûýJź)A7†k €¹,¥³€þ´’Êze¹÷¬äÒt”àÀæ¹µ½©h¸`«{‘Í:/
%€ëš¼ ¶GÇ4¦Lt4öTgpE+ÊPpO>Ùâ¯Vlށˆãœrs]> s€:Ž)Ç�)€;Šqs±}+´ò êiŠÑ>‘J1°•8©Jé#¾(EW*{U›dR˜8Áéí]d�3Ò¦ºa³ÔW¯¨u\€®1Øb‰¦^¨®ÚÇ¥uTá²2@ÏZ—"&0 ‘ŒRd‡hü ±þ.¹ø¬šØ#”lð¿Ö’>ja´`ŒTçƒL‰aFßÌsUoá®�{Ӟ’€ëù5ÄÚ®qíÎ(Q‚zS³Dȶ0Ã#œäRJì`¬»‰ÔՁƒšS9lcãÞ¸ÛI;XŸŒR¶˜¹õžz×6·ÅwÓí@8«8°rŠ(¨Å€¢Š*+Ð (¢P֊(ªõèQRŠ( 9ž?ZíPQJEPQ@QEÂqI,Mu©5”–ÀQE�(¢Š�¢Š(Š(  (¢€(¢ŠÊ(¢µ´Ší%úÒ¨Ø ( u©KvŠé#­8è¡G¤Ž3Ü{֊`hrp)äÑ¹€Á<sÍ'frW¸ëÜÔ
G!†Ñ¸gwr�¤Vʾˆâ=êÅ*õ5ß'�dõ§ƒ'Ppòš¹ ½†Aa?¥hPlFz)9?ÃíNÁ; •¼µÎÒv珵-Ône_ïŠëD̙^HàÜU\r%4˜Ca-ÒÊЀ|°K€p2Ê£„�W_n´ú—±ä°%¸ÉïHE ŀÎÞ猟jŸTËÞÄŔ†Î8aô¥˜’hb@ Ž”ë)UÎ݊:Ò_Bmap1“Û=ÇÍCŠd‘Ðú¸Ã*ü'?ÓùʯQž¹§ðî ¹°s‘]óW*Fwuç½JTUJWT2",àŒ€IÞÝ©SÛ°D1£`CíÆ~ôþÒÉævîÁݎž”ä÷<B]Ì(ĄnBžäT’ÈL
pSŒW9Í ãŽÙ~hü8ãg%{O4` o3eF0EfäÓ%ˆˆ3Ue}ûTT.Ä=
¢°Ü�ã­,€Kç�œv«&Úٚlj4&@ ÚOjK*mäô÷§óùA9 ñÍ(å’͐;b²N2 ØH;@ç4€YÆWŒ <–UTî•þï½4T>ÖçÙ8éöÅV­ƒ†<Æ©!Á—§Þ‘4M&•B (À|RÛpºHN=«¬ (ÜI!»ŽŸjˆö^"®˜6ìcÛµtÂÃk‚¤1'¯ {{ÊeMÜ`Œb’±‚W/$àžxëVF&LtŒ€@íß4¨–4˜4ªW®zŽÿ�®)ˑùrþ—ƒÚNÆeÈV±USI¹‘W‘*¶ÞûûÓLˆˆ21ïïR$PpËÀ›¸_šJ¿ægP~GCZ]È‚Ç™ßØt®:®FÏ֟PĒví<žô�ñÞ¶b0äb†dbŸÚCØ'”D\“êl.(TŒã­(àv å1޾ÄR™r¹¬½³×Š�͓Í(cµZQo "ŒüҎ�⒣œUT>ÀQ]aƒ\ªµôŠ(¨ß°QKX˜®áŒ|(QEEPQ@QEƤE.Nk? rŠ(  (¢€(¢Š�¢Š(Š(  (ÇÅ>ԔQE_€¢Ša=©P¶b¡IôŽƒÚ’:×@a‚vÐ=.7ÝxèˆÎ9ƒŽ¦*ìP9ÀQ•'¡Â8ÛÎTýúš”ñ”e[�ÊÙÈÙØT¦ÙFìc ¦Üz€=ÏJYhÄjNåb:zvÁ4µPSrIê6KŠÜ±e lŒàձɐ6ŠDEŽÓ¼ã'®}¾Ô¡
Ýýњó´€;woŸ½)Žë†*§ÕÐ78ûQøº`hB¥£ ... Лимит на размер Post был достигнут. Удалено Firebug'ом. ... 2–.x_Næ>¥õ$_
*–\d¹ëVwì†ÉvöÏ%Ê»)hÿ�0ÙÓþþ(½óí£yo5KŒõ뚁s¨õAû ë–O¥ûð>)»Û´™/zeߚ‚–ÑkòÇnl˜±
fÚ£ ò9=MNg’6aºC‘°ƒ“òGµQéÞ^C9*\�¤ç8é“Nÿ�hEerf·‘¥1M½éÁç¨Õ¬²Z.nfuì– @ô¸Q”#ôéTò.v£‚3ÎïâÏ|týzÒ§ÖÞæC#¦÷—;Û¦ã×$b£I|Ñ+=¹DrAB:}ëUe ¢äÇhË
P»‰Æ1ýi¦å`±‡ô®Ü¨ÛéÇcÜüÕwö™Üs»•%ºùûÓ©#,ë‡2a°=‡L £ÇÐ4š{,pB<¯SÀ>Ý¿Z»O4�Ò°‘#8aÜ|ç¸ùíY[»§²TXًîm‡pÀϰÉu¦\F¤�‚$vË&òÙ'3Ð/sSÆF,ìPÜKw"éq­æ9^KÝÏùŸåU²ßQ£vØã!rx N?Ÿ/OÖR RxQ¿v Ý´ú˜cøÇRõ¸,ç/ Ý »�ٌøøéUó‹ioíÛ¹™¥q.àGóØüT9 ,ÀÊòÒ¤–\+*äòÙÆíß·5Ø&ko:8£‚C,ẍr¼õSØüÕáãTAE4¸$c#ø¸¨ò È­îTÊß½ È?1#ƒö¨"ã<wªn�¨�c$u¦LDà±ù^ù©OXžRU•X&7–#<¤|ûÔq‚¤ºmÇ=¨Ëÿ�•NFÅF–@Ì@®Äõ§ÿ�åãx¦]·žŠ¶ôªöÁ®oÏjVÌp˃I<”QEWQEXW⡺ap}¦™å²vŽ1Å&‰Ø (¢¤Q@ÐpÀ9î{W+Ò€íp>i9>ôìŽ_`l£�Ž*›èÏ£¨ ãœõïíJf,A<`b¥l Ú(¥°~€}¨¢€)ÀçíMÓ
vªÊ7gjÕI {¾ŸzîFܐ;šã€òذÇ'¥»ã‚O\ ¿ekgP0]È1¸ã'§Ú–ŒQÇåñ“L–llÉÇ÷iq9L˜Êôä0Èþ´,L'$ ‚xÁÏ4âÈAÊçi<àcç5&
*~r?ҞM¥ƒ )‰Ï{ LG(í·1ãósŸæi䘨,™ç9ö£™Ã
Q–"ûÂ£ òûqê àg€*kÉìJåQÃ;öøþõhäÞI@õSG+€ü`ñÇéKó‰<mc“¹CvªdÁwéêà o‚sÓ=zWm¶2ۗ €ØëóÞ ¤ñ©VŒ°Î@›$‡ýk©©(Á!”ðIېaúýª[k¢S¡éâs>Q½MÉ#¦iVèϼ¡WÉ�†à·¿Ú‘muò(BŠz?~µ"åBz"uipêÙûô5)¿e³a$1ªäª‚X`–èGSr&Pà¨UlŠm§1±EeÆá€AûŠí½ÁÈ6.OVïQŒï%ÐSvp2/XÐ6>Õ6&CFÆTQ|ïÞ:íØ8^1Žô¸¶·,BË»$ç·±¬÷ì»v:»»•î8õ©HÊÅØ´kŽK¨¬p=K–Ïæ ÛۊVò@TUUa§¾j¥N @K:*ï*z³7$Uí¼žc*"Ý錆ÎãaÚ³¢!eöo'Ò;T˜¦pJ[°füÎ䃎Þâ¶}{e°–su$ûQd XŒªpxëšr[5˜”ƒåªœaA嘶@¦´‡{{è'ràNNTwø«é¤I!V`be#k`d‚}ºU±ƒ®ÈMÝ"7ãÞÆ§ry1»‘»þÍF¶÷-¶hDk1Ã1Ïa±ûÿ�¥ò¥U}±±Ár—œ{gœç¥&ÛL»–IšiÖ() аèÏíTI֋äßeԖ°[<[ùsÀþú!Ôã՞‡\YlZÜáäaºá†ÓðIïœÕT¢2Ž“É_âS“ƒÆqþ‚¡K¬BєÈ™pHäÓš³~ÊöÆu9NbüGâÖÆìmþZ¬’xæ™F÷a½½Û4ò’ZN]€àY§Rvƒ“ƒƒšÊ1ݗl²(aæñØäâœe¦6.Õêlv¦VÙ÷eH—¯«´„/�ž(ÕrO£¿Š˜#Ä  ª2Êz `M»9ÚÀdexÇÞº2èÃДO84ÙC¸ò¾£ÂŸš×FmŽìm„6÷$€|mö¦¥;w(!¿3 Z3(*v¨Æxè)Äìýãîbzç­t>Š‘¡UnB íÇO¾ijå`b»XŸWb�ÇÚ¤‚ÖÊûU¦ôg¯LÓ÷¬÷q¤f1ˆb*¨Fwgü]O_\àö#c2e½íóÇsO hBLV¹ÏL¸<µUe]ŽÇ F0z•øB·™bÂù‹¼)á¸êJ²ŠîöJtN‹Sµódx|Ž’§¹'·ýjÛ[е;+KK‹‹7ŠÚñKÄ azt-ÇÊô5¤²Ð´{ÍR+È#{4—¶ÎìºþV/ÔÜýª’=M¬�‹Qg’âbÌ\1!XuÂô\ž}5•J-ì¦Q{ögn4Ù-ã-:¸}€í]§œýª.À±e*À’}«i¬_Asao$ I)ƒ+œÝÉ'¨ø5Šº}‹‚b.9!x_Ò¯ví2So²¾â\+�ª2¸ªÉpۛÌÙ!_H§.XŽI\gÐ3ÐüüT“p9`x t¡#{HÈ'¡ãâºÎd9`py¹ÏÎÌgónà|‘H.³.Ö÷ÛÐÕ£Ø9 º iˆš[ò»T㜚h«7%k`6§Þ¸zѸŸá}ëJÀQE”¤¢Š(«€®šía�»EªEPQ@u¢Š›EvŠ**€QE (¢Š�¢Š**ÀW1šíxW°+yÀÉÎ(YU•I ÝG½&ŠÑõ wp-ìiD¯RqóH¢²ÉÈåÚÃ`+òe–³»Óñ֘ wÏdÁ1UÁ$dsŠyDdÏB9ªåb¿þ´êOœ)àƒÉ¨Æ˜'
?áàWc‹s_^xã½2“*©åxîGSí]Žä“¹X/lTÿ�è&Ê|åV|ÁÇA\ýã0U*c¯ýõ¦ã‘0ÈØlŽVõ¿wµPXmç=Æh P˜Ô`2²“Ê·4¢˜vÜI<>* dÚ="<ûsKYˆc¸.ŒŒüÑì$yP€ª‘®Ñê<äv¤,¦\ª±éŽôѹUv
céR™R¦-®=@~|Ñh”IFpÁI°9,A°íÆÆq’‚ßÕÚEMާ'E;&[ äp¹oéŸôªÊÙr\j·’噽«ú¤8cµ†FáÚ¢$ÒBØuBúr9""&ô±Û9ûÖ©‹%ª‘% †\‚mÎN)V“erdV BzIl7þoçQæÚ²l‰‰¶�Ž}©¢$PžA!› ]6••ý–öú¢¶˜f*¤{➛SØv´Ä¢†Ø�݁ýßçU z�q¸‘‚qÓ6T«„Â0ÆTò>qUR÷E:Ùc¥seÅ+�pÅUXã·ôõ¨±ñ_Ø¿€¸±ƒr"Düä“ÇéŠÂ¬Â5gdÜAÛÏ·½*=E¹ÁÛԟéZÆn+H4›.®n–uUa‘ض Ÿšªkb§ÐÁ”ðzf£=Ë䌜šŽ×¬äïÃsÇn*©j‡E²I´`«2ðÉ¿û{Ք2 6¢rߘÖ¨í§†a%°0{Ô©Ø/1±,§®qÏqJ™B©bwÝþôÛl˜¦e¦*¾[ͪ@çߚi¯v‘ðqšc~Â×D™$ UÚ8ÁÆj,’°Î1ŽÄš‹ø­®Ìü`c’)‹‹€ÀN>zš˜*Ð% ³Ð)#ž´¡7þcӚ¥3a¹b>ÔúÊÏë,ŽA?å],Q^3z©?|“ï÷«›ÂÎU¸GÂÆNOQß·Ú²öw-‹:²,£,7cûU
½Ê©G’FÜ1—n¹ÎAÇqUjÁa5ÓÉ#/Þr˂G¹Óô«e‹ë8tÕ´¸†F˜®U‰*³×Š­:˜XdXÑeYI·áª–›Õ3†elä=½føþui®_ÚF¤¨�9VuÆ08;½€«›[á<òÝÉ(–êNzñÁÈì+ç¤r’ûvãnÑÜRN¨#Ê!UpyÀþU*CZ¤kµíQ$C² ã"1éaóŸšÈ\Üabž2OÕÍûÜ3maµÇ ·?zˆò€Iª&\0ÜÐÀwcgȎ-í‚ÏnµÉKí/Î:z¿Ò¸„Æ�”“€JàûÕ ù@�n£Þšf#�(>ê8æžó0ena9ʒg5¢q÷?ð}©Ûea-ò(l† }©%ˆ<Œç½D¥ô‚Eašé9®U�QE”âß@(¢ŠÔQ@QE�QEEPQ@QE�QEEPQ@QAéKK°W÷®ÔåªKFP¬ ‚ǀǵ"Š€çETlQVŽÞÀ°øùNhóN$Ò(©j˜$E1Èʂ~M*;’òe†�<�j(àæºµPM#vW�“ƒ‘‘DŽƒiÜ£àTQÀ já}§§Z”­‚t2º2T†^{T<n!™Jã¦j£Ì
/Îc´ƒØUÜ#Øì¸ó'7aŸëKŽáÂòC犧[†@B‚íڗÓgÇÀ8¬Ê8ȹôw“Æ)BÌAPÌ6þQÇJ©˜ãpÀÇ´›|apª2NìóB姙æ6OOËëç§9ïX6=^Qs÷þTÊ\(Û»*aCœæ¸Ì›‹Æ¸,¼1â¡§Em]¨BUU {žý³]’A±ÚvçïÐ ¨†Q >Æûý©r3#feÜq¤ŽHèj‰Yc²JKŒYHÆ7fš¤¸ÏNôÓÈ Ý»a=ª7˜¡Ê†Î{֋ Miò0yã¥4ònðqŠd‘ß4‡e½cãxW�ŒíÁ5=§TŒØÞÙÿ�*¥‚Pˆ=sR՗nBóŠLä+nÚwœCɁé›vܼà{cŠh÷Š~aQóïšmÝÛaÒ$Ç`ÜÒ2zdŠÖ1]xç=뛱Æ)%ˆë\ëÍ\!|8}©ñs.Ð\¡Ç¤g9ÅDI=@½¨$rXš k²Å/°¾¸ƒ1œò)‰¯¶ò§¦j(›1‘ìi¯I냟z­1ö¹œõý©qÊqœpMB2 véJß±ûT7£VNY=yÈàt¥—g]ËÁö Ô8¦PIã=y¥µÀ ’ø5EåÙÛT“ç),¥6 ÆÄ³qŒ}©·œÌ„ñL™Áà®îù÷©ÅT^\Šä»dÁ#šdÈ­&ÜcÛ&˜y•Úi¾ùÏ5›Ó¯!ɑ¸žµÂsE@ æ~+´T0QEH (¤¦³S°.Šâô®Ô¹�¢Š*¿ (¢Ÿ (¢Ÿ (¢Ÿ (¢Ÿ (¢Ÿ )-ړVR”RaQK¦@(¢ÝjìjMT=€¢Š*�RÇAH§aAL±EVŠHQL (¢¬�pk¤æ¹E�`v («©$€­ßš(«f€­çØWCÁÎ}©T9Eöa˜Ø2`ïJC՛a4Í%ÐÐÿ�ŸÆO?Ó(Ïaӎžÿ�Š†ì‘¾sžœsH8¶‚=©¢(éÈëU
•ˆëÇRœãæ™÷þ”½àõ¦#rm£§¼ÌTr(]°ÆOô«ÆIk¸ÈþUÂäd.ÑúT_;’Jçځ7<ŠÒÓ++ô?&ö‘šà@ó{ŒñL‰±ŒŽ†»æ€£iÉÍ-º:Frtșóz á$œÔ’HcŒ2ãçŠæðãŠcsR„˜\`f¢Ñ X¶(8=M#(À4Íñ\ÙÍW4Hó
#ÓÇzgš cECš`(îh¢³ß QEFÀ–¤ÒŸ­&³}€ v¢Š€9H=Ms'ފ�¢Š(î5Ê( : n5Ê(î4n5Ê)@îãFã\¢¢ÝƍƹE(ÜhÜk”TÐ;¸Ñ¸×(¨ wq£q®QS@é9ë\¢Š�®î5Ê(î5δQ@QE�QE]Ük”PÜhÜk”TRaw7å¤î4n5Ê*ÖÁÝÆÆ¹E@;¸×A$Òk«ÖtQEF pôâÓšíÏôŠ(«®J]�¢Š*~@ÅW Àª¾O@íÀs]¨S§Ð (¢ŽvúEÂp*뒺ah¤î£uNK°*ŠNê7TæQIÝ]#5`íØâÕGO qÒ
$šá9¡zÓØzR7Qèii»erŠ­°tœ×(¢ QQ`(¢ŠZERÐ (¢¤Q@QE�QEEPQ@QE�QEEPQ@QE�QEEPQ@QE�QEEPQ@ÕëE+°.Š(­(QJER€QE Ÿâ¢Š«^@UQZ4Š(¨i�¤§Z(¬xûae­rŠ*_lQPœ¢Š¼@Ûu4QEUöº½h¢‹°(ô4Š(«HQTEPQU`(¢Š¨ (¢€ÿÙ -----------------------------17679742877726586041559880--

and answer is


object(XUploadForm)#49 (11) {

  ["file"]=>

  NULL

  ["mime_type"]=>

  NULL

  ["size"]=>

  NULL

  ["name"]=>

  NULL

  ["filename"]=>

  NULL

  ["secureFileNames"]=>

  bool(false)

  ["_errors":"CModel":private]=>

  array(0) {

  }

  ["_validators":"CModel":private]=>

  NULL

  ["_scenario":"CModel":private]=>

  string(0) ""

  ["_e":"CComponent":private]=>

  NULL

  ["_m":"CComponent":private]=>

  NULL

}

I’m not sure what you are trying to do, please take a look at this article and see if you can find something you are doing wrong

The Xupload extension does not support chunked uploads. Or does it?

Guys im having this error with this extention, but with the jquery itself. Did anyone face the same issue and perhaps knows how to solve it or what could it be the root cause?

thanks!

Hi,

I ran into the same problem a stated below and took a dive in the XUploadAction.

I have reasons to believe that there is a small feature, that causes to never use the get variable at all. It will only look for the get variable when the subfolderVar is null. This is not correct.

I needed to change the following code to make it work. Is this a valid fix?


 

if( $this->subfolderVar === null ) {

    $this->_subfolder = date( "mdY" );

} else if($this->subfolderVar !== false ) {

    $this->_subfolder = Yii::app( )->request->getQuery( $this->subfolderVar, date( "mdY" ) );

}



Asgaroth, could you give your opinion about this?

what is it you need to change? i got lost

Hi,

Great Extension, comprehensively documented for create action. What about update? How to give existing file names to the extension, to have the images in the "table table-striped" table?

Thank for your support!

Hi Asgaroth, thank you for this great extension.

I would like to add my vote for further development of it, a target directory display similar to the download template that would link in with your current js structures. I am currently php-hardcoding the list, displaying from db in the xupload form and plugging in my own actions to those events, which feels like a quickfix. Other modifications i am now working on are multiple filesizes/cropping, and list ordering.

Kindly and much regard.

Hi, thanks for your comments,

This is something people has been requiring for some time. and its defenitely on my TODO list, I just haven’t have the time to do it. the project its open source, and if you have any code you think we can add to help other, you are more than welcome to contribute.

Hi Asgaroth,

I’m a few weeks beginner on yii. I saw your extension and i think it’s great. It’s possible to use multiple XUpload widgets on the same page? I have a model that contains additional data, an image file, and 2 other video files (flv, mp4…) it’s there a way to upload each of them in the same page?

Thanks,

Tiky

I have fakepath problem in ie. How to solve this. Thanks

Hi,

I have a question on the $path variable inside Controller’s action.

What is the difference between $path and $publicPath?

I have the following case after applying the extension on my project.

On the controller action, I specify the path to be:

$path = realpath( Yii::app( )->getBasePath( )."/../images/" ) . "/";

And it works, when I click ‘start’, the image will uploaded to /images/<filename>.

Then I tried to change the $path to be:

$path = realpath( Yii::app( )->getBasePath( )."/../images/tmp/" ) . "/";

Under ‘images’ folder, there’s no ‘tmp’ folder. I want the action to check if the dir ‘tmp’ exist, before the image is moved to the temporary folder using following codes:




if( $model->validate( ) ) {

                //Move our file to our temporary dir

                $model->file->saveAs( $path.$filename );

                chmod( $path.$filename, 0777 );



However, I can’t make the system to create the ‘tmp’ folder which resulted in ‘Internal Server Error’.

Any idea why it happened?

Another question, where can I set the maximum filesize limit? With the current code, I always encounter ‘Internal Server Error’ when I upload few MB image.

Thank you.

Hi Asgaroth, great extension,

im having a little problem with the demo…

Im trying to remove the table of uploaded files from the form template, i set the widget to autoUpload the file but i dont see any ajax response.

It works if i dont remove the table from the form, im probably missing something here.

im commenting this out.




<!-- The table listing the files available for upload/download -->

<!--<table class="table table-striped"> -->

<!--	<tbody class="files" data-toggle="modal-gallery" data-target="#modal-gallery"></tbody> -->

<!--</table> -->



thanks.

Solved it.

Instead of commenting that out i created my own uploadView and modified to my needs.

Hi Asgaroth,

thanks for the great extension!

I have a question. In my application i need to upload video file and a thumbnail to it.

Is it possible to configure the extension this way? Or i need to add two xuploaders to my page?

Thanks in advance!

If you only need a single file upload (or 2) then you may not need a multifile uploader, this extension is better suit to upload many files.

in your case, you are only uploading a single video, and a single image, so there is no need. unless you were uploading say 5 videos at a time.