Uploadify3.1下傳5M以下檔案顯示成功,實際沒下傳成功

來源:互聯網
上載者:User
Uploadify3.1上傳5M以上檔案顯示成功,實際沒上傳成功
PHP Uploadify3.1上傳4M多的可以上傳成功,上傳大點的,進度條和提示都顯示成功,但實際檔案沒上傳成功,調試環境IIS6
,可以確認路徑沒問題,操作應該也沒問題,是不是uploadify本身不能上傳大檔案?還有沒有其他好的上傳大檔案的PHP外掛程式介紹。
JS代碼如下
JScript code
$(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代碼如下
PHP code
$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.';    }}




------解決方案--------------------
不是程式就是環境限制了上傳大小
------解決方案--------------------
探討

大哥可否說詳細點 這個上傳不上分塊上傳的嗎?
如果不上分塊的 估計肯定是上傳不了的

------解決方案--------------------
if (!empty($_FILES)) {
if($_FILES['Filedata']['error'] != 0) die('錯誤號碼:' . $_FILES['Filedata']['error']);
$tempFile = $_FILES['Filedata']['tmp_name'];
....
------解決方案--------------------
php.ini設定max_post_size大於等於5m就行了
  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.