Home » Php » php – Yii2 kartik file upload widget issue

php – Yii2 kartik file upload widget issue

Posted by: admin February 25, 2020 Leave a comment


i have created a fileupload using kartik file upload widget in yii2.And the widget code

<?=$form->field($model, 'file[]')->widget(FileInput::classname(), [
    'pluginOptions' => [
        'initialCaption'=>"The Moon and the Earth",
        'initialPreviewConfig' => [
            ['caption' => 'Moon.jpg', 'size' => '873727'],
            ['caption' => 'Earth.jpg', 'size' => '1287883'],
        'showCaption' => false,
        'showRemove' => false,
        'showUpload' => false,
        'showCancel' => false,
        'browseClass' => 'btn btn-theme btn-lg btn-block',
        'browseIcon' => '<i class="glyphicon glyphicon-camera"></i> ',
        'browseLabel' =>  'Select Photo',
    'options' => ['accept' => 'image/*','multiple'=>true]

Please check the below image to view the output
enter image description here

in image we can see that for the initial preview images there is move icon to move the image and we can arrange the position.But when i select another file it doesn’t have the move icon.
How can i add move button to the newly selected files.Because i don’t want to set initial Images

How to&Answers: