為什么我修改了post_max_size = 8M enable_post_data_reading = On 同時max_execution_time = -1 max_input_time = -1 upload_max_filesize = 64M 我將一個文件夾壓縮到6M后進行上傳,為什么傳了一會瀏覽器就斷開連接了呢,顯示連接已重置。 如果我將enable_post_data_reading = Off那么會出現(xiàn)POST Content-Length of 6347436 bytes exceeds the limit of 3145728 bytes 這說明必須將其設置為on,(配置文件中有Its value may be 0 to disable the limit. It is ignored if POST data reading is disabled through enable_post_data_reading.)?,F(xiàn)在的問題是為什么設置On之后就出現(xiàn)上面那個錯誤了呢?!6M不大呀,老師這是什么情況啊?!
2014-11-20
是因為超過了post_max_size選項的值,你需要把upload_max_filesize和post的都改大才行,post_max_size是表單發(fā)送數(shù)據(jù)的最大值,要比upload_max_filesize選項的值大,因為表單還可以發(fā)送其它數(shù)據(jù)
^-^...
2016-07-23
首先你確認一下,你做的判斷是$error===UPLOAD_ERR_OK--->三個等號哦,如果是==,那么當超過post_max_size的時候$_FILES接受不到值,那么這個時候$error就是空字符串,而UPLOAD_ERR_OK的值是0,
0==''的結果是true,所以不會進入else循環(huán)。
解決方法:
? 判斷條件:$error===UPLOAD_ERR_OK或者$error==UPLOAD_ERR_OK&&$error!=null,
當然文件超過post_max_size沒有錯誤編號,所以你在switch($error)中加個default吧,就能看到你想要的結果了。祝你好運!
2016-06-15
為什么我修改了post_max_size = 8M enable_post_data_reading = On 同時max_execution_time = -1 max_input_time = -1 upload_max_filesize = 64M 我將一個文件夾壓縮到6M后進行上傳,為什么傳了一會瀏覽器就斷開連接了呢,顯示連接已重置。 如果我將enable_post_data_reading = Off那么會出現(xiàn)POST Content-Length of 6347436 bytes exceeds the limit of 3145728 bytes 這說明必須將其設置為on,(配置文件中有Its value may be 0 to disable the limit. It is ignored if POST data reading is disabled through enable_post_data_reading.)?,F(xiàn)在的問題是為什么設置On之后就出現(xiàn)上面那個錯誤了呢?!6M不大呀,老師這是什么情況啊?!