2010-10-27 119 views
3

我使用從這裏插件:http://www.uploadify.com/「HTTP錯誤」使用Uploadify的jQuery插件

我已經安裝了一個簡單的測試情況下,選擇一個文件等&我得到一個「HTTP錯誤」當我嘗試上傳。

這裏是我的頭相關的代碼..

<script type="text/javascript" src="../js/jquery.js"></script> 
<script type="text/javascript" src="../js/swfobject.js"></script> 
<script type="text/javascript" src="js/jquery.uploadify.v2.1.0.min.js"></script> 
<link href="css/reset.css" rel="stylesheet" type="text/css" /> 
<link href="css/admin.css" rel="stylesheet" type="text/css"> 

<script type="text/javascript"> 
$(document).ready(function() { 
    $('#sampleFile').uploadify({ 
     'uploader': 'include/uploadify/uploadify.swf', 
     'script': 'upload_test.php', 
     'folder': '/work/avais/bizlists/lists', 
     'cancelImg': 'include/uploadify/cancel.png' 
    }); 
}); 
</script> 

</head> 

..這裏是我的html代碼..

<div id="upload_wrapper"> 
    <input type="text" name="full_name" /><br /> 
    <input id="sampleFile" name="sampleFile" type="file" /> 
    <input type="button" name="upload" value="Upload" onclick="javascript:$('#sampleFile').uploadifyUpload();" /> 
</div> 

我將提供鏈接,但它是一個管理區域內。

我找不到任何關於此插件故障排除的文檔。

編輯:我拉琴&檢查它似乎我得到一個「響應代碼413 - 請求實體太大」的錯誤。

編輯:問題修復....這是一個問題,我在.htaccess文件中有一些東西,可能是「LimitRequestBody」。

+0

的HTTP錯誤?您可以使用像fiddler這樣的http閱讀器來驗證調試您的請求。 – 2010-10-27 15:29:16

+0

好的謝謝。我不確定哪個http錯誤....當我點擊上傳按鈕時,它說的是「HTTP錯誤」。 – Brett 2010-10-27 15:43:00

+0

好的,我用提琴檢查它,似乎我得到一個「響應代碼413 - 請求實體太大」的錯誤。 – Brett 2010-10-27 16:18:01

回答

1

問題修復....這是我在.htaccess文件中的一些問題,可能是「LimitRequestBody」。

不知道爲什麼這些設置影響它,因爲我已經設置有比我要上傳的文件較大值的值,但可惜的代碼,我拿出的.htaccess的是下面..

php_value upload_max_filesize 256MB 
php_value post_max_size 300MB 
php_value max_input_time 500 
LimitRequestBody 500MB 
+0

我得到500 - 內部服務器錯誤,爲什麼? – 2016-05-05 11:57:39

+1

也許user588725的回答會幫助你!? – Brett 2016-05-06 07:52:39

+0

不幸的是,我確實嘗試過,但問題仍然存在於大型文件中。 – 2016-05-06 12:52:20

3

我得到了一個不同的HTTP錯誤:HTTP未定義或HTTP 500.搜索網絡4個小時後,我找到了答案。

這是因爲服務器使用Mod_Security。要關閉它,添加這些行.htacess文件

<Ifmodule mod_php5.c> 
SecFilterEngine "off" 
SecFilterScanPOST "off" 
</Ifmodule> 

信用:scaturan張貼在http://gallery.menalto.com/node/94614