它没有显示错误,并且看起来像在工作。但它不会将图像上传到服务器。
在本地主机上工作的相同代码。
阅读有关此问题的内容,但仍然没有解决方案:
同样的问题:
http://www.uploadify.com/forums/discussion/6974/upload-ok-but-file-not-in-target-folder/p1
http://www.uploadify.com/forum/#/discussion/5527/upload-does-not-work-no-errors/p1
查询:
$("#fileUpload2").fileUpload({
'uploader': 'uploadify/uploader.swf',
'cancelImg': 'uploadify/cancel.png',
'script': 'uploadify/upload.php',
'folder': '/files',
'multi': true,
'buttonText': 'start upl',
'checkScript': 'uploadify/check.php',
'displayData': 'speed',
'simUploadLimit': 2,
'onComplete':function(event, ID, fileObj, response, data){
foto=foto+fileObj.name;
}
});
上传.php
<?php
if (!empty($_FILES)) {
$tempFile = $_FILES['Filedata']['tmp_name'];
$targetPath = $_SERVER['DOCUMENT_ROOT'] . $_GET['folder'] . '/';
$targetFile = str_replace('//','/',$targetPath) . $_FILES['Filedata']['name'];
$ff= $_FILES['Filedata']['name'];
echo $ff;
// Uncomment the following line if you want to make the directory if it doesn't exist
// mkdir(str_replace('//','/',$targetPath), 0755, true);
move_uploaded_file($tempFile,$targetFile);
}
echo '1';
?>