-1

I am using coco file up-loader extension in my Yii1.x framework but its not working properly. 1: Like if I want to delete a uploaded file name from status area its not working. 2: I am not able to make a limit to upload files if I want to edit a file. 3: Its have also UI issues.

I am using coco like this.

widget('ext.coco.CocoWidget'
        ,array(
            'id'=>'cocowidget1',
            'onCompleted'=>'function(id,filename,jsoninfo){  }',
            'onCancelled'=>'function(id,filename){ alert("cancelled"); }',
            'onMessage'=>'function(m){ alert(m); }',
            'allowedExtensions'=>array('jpeg','jpg','gif','png'), // server-side mime-type validated
            'sizeLimit'=>2000000, // limit in server-side and in client-side
            'uploadDir' => 'assets/', // coco will @mkdir it
            // this arguments are used to send a notification
            // on a specific class when a new file is uploaded,
            'receptorClassName'=>'application.models.MyModel',
            'methodName'=>'onFileUploaded',
            'userdata'=>$model->primaryKey,
            // controls how many files must be uploaded
            'maxUploads'=>3, // defaults to -1 (unlimited)
            'maxUploadsReachMessage'=>'No more files allowed', // if empty, no message is shown
            // controls how many files the can select (not upload, for uploads see also: maxUploads)
            'multipleFileSelection'=>true, // true or false, defaults: true
        ));
    ?>

1 Answers1

0

This issue got when we are going to update a gallery images, But now we resolved that issue using below point.

1: 'onCompleted'=>'function(id,filename,jsoninfo){ }', we can call a custom AJAX call where we can delete our files.

2: If we deleted any uploaded items, then we can set here a hidden fields where we can set counters for uploaded files and on select another files to upload we able to show alert for how many files you can upload.