PHP Uploadify3.1上传4M多的可以上传成功,上传大点的,进度条和提示都显示成功,但实际文件没上传成功,调试环境IIS6
,可以确认路径没问题,操作应该也没问题,是不是uploadify本身不能上传大文件?还有没有其他好的上传大文件的PHP插件介绍。
JS代码如下$(function() {
        $('#file_upload').uploadify({
            'swf'      : 'uploadify.swf',
            'uploader' : 'uploadify.php',
'buttonText':'上传',
'auto'     : false,
'height': 24,
            'width': 50,
'cancelImage': 'uploadify-cancel.png',
            'checkExisting':'check-exists.php',
'multi':false,
'fileDataName': 'Filedata',
'fileTypeDesc': 'FLV视频文件和图片文件',
'fileTypeExts':'*.flv;*.jpg;*.iso',
'onUploadError' : function(file,errorCode,errorMsg,errorString,swfuploadifyQueue){
alert(errorMsg);//上传文件出错是触发(每个出错文件触发一次)
},
'onUploadSuccess':function(file,data,response){
  alert( 'id: ' + file.id+ ' - 索引: ' + file.index+ ' - 文件名: ' + file.name + ' - 文件大小: ' + file.size+ ' - 类型: ' + file.type+ ' - 创建日期: ' + file.creationdate+ ' - 修改日期: ' + file.modificationdate+ ' - 文件状态: ' + file.filestatus + ' - 服务器端消息: ' + data+ ' - 是否上传成功: ' + response); }
            // Your options here
        });
    });PHP上传文件uploadify.php代码如下
$targetFolder = '/uploads'; // Relative to the rootif (!empty($_FILES)) {
$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','flv','iso'); // 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.';
}
}

解决方案 »

  1.   

    PHP ini文件有上传文件大小的限制。你自己查查吧
      

  2.   

    if (!empty($_FILES)) {
      if($_FILES['Filedata']['error'] != 0) die('错误号:' . $_FILES['Filedata']['error']);
      $tempFile = $_FILES['Filedata']['tmp_name'];
    ....
      

  3.   

    php.ini设置max_post_size大于等于5m就行了
      

  4.   

    php.ini设置max_post_size 和其他为100M了  还是不行
      

  5.   

    设置了max_post_size  后需要重启
      

  6.   

    echo ini_get('upload_max_filesize');
    echo ini_get('post_max_size');  这两个值是多少。像 #4 版主那样试试看能不能输出错误号。
      

  7.   

    应该是你后端写的处理上传的代码的问题。顺便请教下,onUploadSuccess(file)中的file参数是怎么获取到的啊,file中都有哪些属性,uploadify的文档中都没有啊啊,还有data,response等等