哪个是 Yii1.x 框架的最佳文件上传器扩展?
Which one is a best file up-loader extension for Yii1.x framework?
我在 Yii1.x 框架中使用 coco 文件上传器扩展,但它无法正常工作。
1:就像我想从状态区域删除上传的文件名一样,它不起作用。
2:如果我想编辑文件,我无法限制上传文件。
3: 它也有 UI 个问题。
我是这样用coco的
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:'onCompleted'=>'function(id,filename,jsoninfo){ }',我们可以调用自定义 AJAX 调用,我们可以在其中删除我们的文件。
2:如果我们删除了任何上传的项目,那么我们可以在这里设置一个隐藏字段,我们可以在其中设置上传文件的计数器,并且在 select 另一个要上传的文件上我们可以显示有多少文件的警报你可以上传。
我在 Yii1.x 框架中使用 coco 文件上传器扩展,但它无法正常工作。 1:就像我想从状态区域删除上传的文件名一样,它不起作用。 2:如果我想编辑文件,我无法限制上传文件。 3: 它也有 UI 个问题。
我是这样用coco的
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:'onCompleted'=>'function(id,filename,jsoninfo){ }',我们可以调用自定义 AJAX 调用,我们可以在其中删除我们的文件。
2:如果我们删除了任何上传的项目,那么我们可以在这里设置一个隐藏字段,我们可以在其中设置上传文件的计数器,并且在 select 另一个要上传的文件上我们可以显示有多少文件的警报你可以上传。