2017-10-07 213 views
0

我正在面對000webhost上的這個問題,當我試圖將excel文件上傳到數據庫時。POST請求或請求中提供的數據量超過容量限制

這裏是我的測試網站Test site for Excel Sheets

的鏈接有與largedata.xlsx我想上傳此文件名的文件。 Here

這需要一些時間,但這也顯示錯誤信息POST requests, or the amount of data provided in the request exceeds the capacity limit.

之後我搜索這個和.htaccess文件已經更新post_max_sizeupload_max_filesize您可以檢查info.php這個細節。但我仍然面臨這個問題。

的.htaccess

php_value post_max_size xxM 
php_value upload_max_filesize xxM 

更換XX與你的價值。

+0

那麼您希望我們做什麼?如果數據超出限制,則出於安全原因而終止該進程。 – arkascha

+0

關於該動態配置文件(「.htaccess」樣式文件)...你確定它是否被認爲是所有?您需要首先在您的主機配置中啓用它的解釋。在文檔中查看'AllowOverride'指令。 – arkascha

+0

我想問是否有任何問題與我的代碼或它是從託管提供商? –

回答

0

當請求正文大於服務器配置爲允許時發生413錯誤。以下是您可以如何修復它,具體取決於您的網絡服務器:

Apache: Set the LimitRequestBody directive in either your httpd.conf file or a local .htaccess file. (https://stackoverflow.com/a/3719358/1688568) 

Nginx: Set the client_max_body_size directive in nginx.conf (http://www.cyberciti.biz/faq/linux-unix-bsd-nginx-413-request-entity-too-large/) 

IIS: Set the uploadreadaheadsize config setting (http://blogs.msdn.com/b/jiruss/archive/2007/04/13/http-413-request-entity-too-large-can-t-upload-large-files-using-iis6.aspx)