1
在uploadify中,后端PHP文件回显“1”,表示上传已完成。同样,如果我想从PHP脚本获取一些错误信息到上传页面,我需要在函数中回显错误。Uploadify with CodeIgniter
例如:
<?php
if (!empty($_FILES)) {
$tempFile = $_FILES['Filedata']['tmp_name'];
$targetPath = $_SERVER['DOCUMENT_ROOT'] . $_GET['folder'] . '/';
$targetFile = str_replace('//','/',$targetPath) . $_FILES['Filedata']['name'];
move_uploaded_file($tempFile,$targetFile);
}
if ($error){ //some error.
echo $error; //dont want to echo
} else {
echo '1'; //dont want to echo
}
?>
我试图使用CodeIgniter框架uploadify整合,所以我使用的控制器功能来处理上载。我不想在控制器中的函数中写入很多回显命令,我试图使用“返回1”,但它不起作用。 有什么办法来