关于网友提出的“Uploadify 上传图片后找不到文件!!”问题疑问,本网通过在网上对“Uploadify 上传图片后找不到文件!!”有关的相关答案进行了整理,供用户进行参考,详细问题解答如下:
问题:Uploadify 上传图片后找不到文件!!
描述:
谁用过Uploadify 使用官网的demo上传图片显示成功但是文件没有!!!
/*
Uploadify
Copyright (c) 2012 Reactive Apps, Ronnie Garcia
Released under the MIT License
*/
// Define a destination
$targetFolder = '/uploads'; // Relative to the root
$verifyToken = md5('unique_salt' . $_POST['timestamp']);
if (!empty($_FILES) && $_POST['token'] == $verifyToken) {
$tempFile = $_FILES['Filedata']['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['Filedata']['name']);
if (in_array($fileParts['extension'],$fileTypes)) {
move_uploaded_file($tempFile,$targetFile);
echo '1';
} else {
echo 'Invalid file type.';
}
}
?>
都是官网的demo,怎么弄也没有文件!!!!


解决方案1:
//下面这句用的是根目录
$targetFolder = '/uploads';
以上介绍了“Uploadify 上传图片后找不到文件!!”的问题解答,希望对有需要的网友有所帮助。
本文网址链接:http://www.codes51.com/itwd/953511.html