regards,
I had a strange error with this extension. Upload and everything works great, but if you upload a file and let’s say “actionUpload” controller does not return false then the progress bar does not work. Before it worked, quite a strange thing.
Details:
$this->widget('ext.uploadify.MUploadify', array(
'name' => 'Photo',
'buttonText'=>t('Upload photos'),
'script'=>array('photo/upload'),
'fileExt' => '*.jpg;*.png;',
'scriptData' => array('id'=>$_GET['id']),
'method' => 'post',
'multi' => true,
'auto' => true,
// 'onComplete' => "js:function (event, ID, fileObj, response, data) {
// alert('asd');
// }",
'onAllComplete' => "js:function (event, data) {
alert('bla');
$('body').loadCropper('/set/photos/id/".$_GET['id']."');
}",
'onError' => "js:function (event,ID,fileObj,errorObj) {
alert('Error: ' + ID + errorObj.type + errorObj.info);
}",
));
public function actionUpload() {
if (isset($_POST['Photo'])) {
$imageoriginal = CUploadedFile::getInstanceByName('Photo');
(.....................)
if ($imageoriginal->saveAs($location)) {
}
}
return false; /* Without this line progress bar doesnt work*/
}
Folder creation, resize, upload and everything works, but removing "return false" results with no progress bar and no events after upload (onComplete etc.)…
there is one little problem with "return false":
2011/08/24 16:08:48 [error] [exception.CHttpException.400] exception 'CHttpException' with message 'Your request is invalid.' in \yii-1.1.8.r3324\framework\web\CController.php:328
Edit: solution: in controller put echo true; 