Boa Tarde!
Estou tentando instalar o widget uploadify (http://www.uploadify.com) e chama-lo no _form da minha página de upload, fiz o download do jquery.uploadify-v2.1.0, descompactei e copiei para o protected/extensions, e usei os seguintes códigos:
Na view _form:
<?php
$this->widget('application.extensions.uploadify.uploadifyWidget',
array(
'name'=>'uploadme',
'options'=> array(
//'uploader' => '/js/uploadify.swf',
'script' => $this->createUrl('test/UploadedFiles'),
'cancelImg' => '/js/cancel.png',
'auto' => true,
'multi' => false,
'folder' => '/tmp',
'scriptData' => array('extraVar' => 1234, 'PHPSESSID' => session_id()),
//'fileDesc' => 'Declaratiebestanden',
//'fileExt' => '*.*',
'buttonText' => 'Upload bestanden',
'buttonImg' => '/images/upload.gif',
'width' => 150,
),
'callbacks' => array(
'onError' => 'function(evt,queueId,fileObj,errorObj){alert("Error: " + errorObj.type + "\nInfo: " + errorObj.info);}',
'onComplete' => 'function(){alert("Complete");}',
'onCancel' => 'function(evt,queueId,fileObj,data){alert("Cancelled");}',
)
));
?>
No controller:
public function actionUploadedFiles()
{
// flash does NOT pass the session
// thus we pass the id with a $_POST variable
Yii::app()->session->sessionID = $_POST['PHPSESSID'];
Yii::app()->session->init();
// Do whatever you need to do with the files you just received
$files = var_export($_FILES, true);
$this->log('Files ' . $files);
echo 1;
}
De acordo com a documentação no site do yii framework (http://www.yiiframework.com/extension/euploadify/).
Mas nao funcionou.
Alguem pode me ajudar por favor?