Php Uploadify显示已完成,但目录中没有文件

Php Uploadify显示已完成,但目录中没有文件,php,Php,我正在使用uploadify进行文件上传。 它显示的进展和完成,但当我在目录中查看没有文件上传 这是我的密码: index.php <!DOCTYPE html> <html> <head> <title>My Uploadify Implementation</title> <link rel="stylesheet" type="text/css" href="uploadify/uploadify.css"> <

我正在使用uploadify进行文件上传。 它显示的进展和完成,但当我在目录中查看没有文件上传

这是我的密码: index.php

<!DOCTYPE html>
<html>
<head>
<title>My Uploadify Implementation</title>
<link rel="stylesheet" type="text/css" href="uploadify/uploadify.css">
<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="uploadify/jquery.uploadify.min.js"></script>
<script type="text/javascript">
$(function() {
    $('#file_upload').uploadify({
        'swf'      : 'uploadify/uploadify.swf',
        'uploader' : 'uploadify/uploadify.php'
        // Your options here
    });
});
</script>
</head>
<body>
<input type="file" name="file_upload" id="file_upload" />
</body>
</html>
<?php
// Define a destination
$targetFolder = '/uploads'; // Relative to the root

$verifyToken = md5('unique_salt' . $_POST['timestamp']);

if (!empty($_FILES) && $_POST['token'] == $verifyToken) {
$tempFile = $_FILES['file_upload']['tmp_name'];
$targetPath = $_SERVER['DOCUMENT_ROOT'] . $targetFolder;
$targetFile = rtrim($targetPath,'/') . '/' . $_FILES['Filedata']['name'];

// Validate the file type
$fileTypes = array('jpg','jpeg','gif','png'); // File extensions
$fileParts = pathinfo($_FILES['file_upload']['name']);

if (in_array($fileParts['extension'],$fileTypes)) {
    move_uploaded_file($tempFile,$targetFile);
    echo '1';
} else {
    echo 'Invalid file type.';
}
}
?>

我的Uploadify实现
$(函数(){
$('#文件上传')。上传({
'swf':'uploadify/uploadify.swf',
'uploader':'uploadify/uploadify.php'
//你的选择在这里
});
});
uploadify.php

<!DOCTYPE html>
<html>
<head>
<title>My Uploadify Implementation</title>
<link rel="stylesheet" type="text/css" href="uploadify/uploadify.css">
<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="uploadify/jquery.uploadify.min.js"></script>
<script type="text/javascript">
$(function() {
    $('#file_upload').uploadify({
        'swf'      : 'uploadify/uploadify.swf',
        'uploader' : 'uploadify/uploadify.php'
        // Your options here
    });
});
</script>
</head>
<body>
<input type="file" name="file_upload" id="file_upload" />
</body>
</html>
<?php
// Define a destination
$targetFolder = '/uploads'; // Relative to the root

$verifyToken = md5('unique_salt' . $_POST['timestamp']);

if (!empty($_FILES) && $_POST['token'] == $verifyToken) {
$tempFile = $_FILES['file_upload']['tmp_name'];
$targetPath = $_SERVER['DOCUMENT_ROOT'] . $targetFolder;
$targetFile = rtrim($targetPath,'/') . '/' . $_FILES['Filedata']['name'];

// Validate the file type
$fileTypes = array('jpg','jpeg','gif','png'); // File extensions
$fileParts = pathinfo($_FILES['file_upload']['name']);

if (in_array($fileParts['extension'],$fileTypes)) {
    move_uploaded_file($tempFile,$targetFile);
    echo '1';
} else {
    echo 'Invalid file type.';
}
}
?>

这是我的FTP目录的截图

使用Google Chrome(不确定其他浏览器),当您尝试上传内容时,您是否会在屏幕左下角看到“上传”消息?可能是重复的,您得到的是您正在回显的
1
,没有错误(您打开了错误报告),你确定你有写权限。@cybermonkey我在上传时在屏幕的左角看不到上传消息。但是,控制台返回“资源被解释为图像,但使用MIME类型text/html传输:?”