Uploadify完成但没有';t上传


Uploadify completes but doesn't upload

我正在尝试在我的网站上使用Uploadify,并使用以下Uploadify.php进行设置:

<?php
// Define a destination
//$targetFolder = '/uploads'; // Relative to the root
if (!empty($_FILES)) {
$tempFile = $_FILES['Filedata']['tmp_name'];
$targetPath = $_SERVER['DOCUMENT_ROOT'];
$targetFile = rtrim($targetPath,'/') . '/' . $_FILES['Filedata']['name'];
// Validate the file type
$fileTypes = array('jpg','jpeg','gif','png'); // File extensions
$fileParts = pathinfo($_FILES['Filedata']['name']);
if (in_array($fileParts['extension'],$fileTypes)) {
move_uploaded_file($tempFile,$targetFile);
  echo '1';
} else {
  echo 'Invalid file type.';
}
}
?>

它没有上传,所以我评论掉了$targetFolder,并更改了$targetPath,使其只是文档根。当我尝试用Uploadify上传file.txt时,这导致$targetFile为/home/user/public_html/example.com/file.txt。文件夹设置为755。我不知道可能是什么问题。否则,我使用的是Uploadify的普通安装,除了文件从未真正到达它应该去的地方之外,一切似乎都很好。

文件夹权限未设置为755是个问题。我注销并返回cPanel,现在一切正常。