thanks for your suggestion
so far these help me to fix the part to access update.php trought the uploadFileAction
but now I'm getting other errors:
error HTTP: 403
error IO: Error #2038
protected/extensions/uploadify/views/uploadifyWidget.php
<link rel="stylesheet" href="/uploadify/uploadify.css" type="text/css" />
<script type="text/javascript" src="uploadify/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="uploadify/jquery.uploadify.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$("#fileUpload").fileUpload({
'uploader': 'uploadify/upload.swf',
'cancelImg': '<?php echo $cancelImg; ?>',
'script': 'upload::controller()->upload()',
'folder': '<?php echo $folder; ?>',
'fileDesc': 'Image Files',
'fileExt': '*.jpg;*.jpeg;*.gif;*.png',
'multi': true,
'buttonText': '<?php echo $buttonText; ?>',
'displayData': 'speed',
'simUploadLimit': 1,
'onComplete': complete,
onerror: function (a, b, c, d) {
if (d.status == 404)
alert('Could not find upload script (upload::controller()->upload())');
else if (d.type === "HTTP")
alert('error '+d.type+": "+d.status);
else if (d.type ==="File Size")
alert(c.name+' '+d.type+' Limit: '+Math.round(d.sizeLimit/1024)+'KB');
else
alert('error '+d.type+": "+d.text);
},
});
function complete(evnt, queueID, fileObj, response, data) {
alert("We are done!");
}
});
</script>
protected/controllers/upload/UploadFileAction.php
<?php
class UploadFileAction extends CAction {
public function run() {
if (!empty($_FILES)) {
$tempFile = $_FILES['Filedata']['tmp_name'];
$name = substr($_FILES['Filedata']['name'], 0, -4);
$targetPath = $_SERVER['DOCUMENT_ROOT'] . $_GET['folder'] . '/' .$name;
$targetFile = str_replace('//','/',$targetPath) . $_FILES['Filedata']['name'];
mkdir(str_replace('//','/',$targetPath), 0755, true);
move_uploaded_file($tempFile,$targetFile);
}
echo '1';
}
}
?>
and protected/controllers/uploadController.php
<?php
class UploadController extends CController {
public function actions() {
return array(
'upload'=>'application.controllers.upload.UploadFileAction',
);
}
}
?>
do you know what is wrong? thanks in advance!