Yii Framework Forum: Upload File with CMultiFileUpload and ajax - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Upload File with CMultiFileUpload and ajax Rate Topic: -----

#1 User is offline   prasetutama 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 48
  • Joined: 29-June 11

Posted 17 December 2011 - 03:07 AM

Hello friend i want to make file upload with CMultiFileUpload and ajax. I have made for form and controller, but i'm confused for render information throughout ajax.

My view
<div class="form">
    <?php
    $form = $this->beginWidget('CActiveForm', array(
        'id' => 'upload',
        'enableAjaxValidation' => false,
        'action' => '/prototipe/index.php?r=upload/upload',
        'enableClientValidation' => true,
        'htmlOptions' => array('enctype' => 'multipart/form-data'),
        'clientOptions' => array(
            'validateOnSubmit' => true,
        ),
            ));
    ?>
    <?php
        $this->widget('CMultiFileUpload', array(
      'name' => 'files',
      'accept' => 'jpg',
      'max' => 1,
      'remove' => Yii::t('ui', 'Hapus'),
      //'denied'=>'', message that is displayed when a file type is not allowed
      //'duplicate'=>'', message that is displayed when a file appears twice
      'htmlOptions' => array('size' => 25),
      ));

      
    ?>
   

    <?php if (CCaptcha::checkRequirements()): ?>
        <div class="row">
            <?php echo $form->labelEx($model, 'CHAPTCA'); ?>
            <div>
                <?php $this->widget('CCaptcha'); ?>
                <div class="row">
                    <?php echo $form->textField($model, 'CHAPTCA'); ?>
                </div>
            </div>

            <?php echo $form->error($model, 'CHAPTCA'); ?>
        </div>
    <?php endif; ?>
    <div class="row buttons">

        <?php
        echo CHtml::submitButton('Unggah', array(
            'id' => 'uggahButton',
                )
        );
        ?>


    </div>

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




Do you have solution, i use chaptcha in my form
0

#2 User is offline   maxazan 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 14-January 12

Posted 02 April 2012 - 01:23 PM

Quote

File uploads are not performed using normal "Ajax" techniques, that is they are not performed using XMLHttpRequests.


You can read about in this topic
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users