上传图片时出现此错误:(一张图片最大 8mb)
Warning: POST Content-Length of 14259306 bytes exceeds the limit of 8388608 bytes in Unknown on line 0
如何自定义显示此消息?我的意思是我想把这个错误放在 CSS 样式中。谢谢....
最佳答案
也许你想尝试这样的事情。
if (isset($_SERVER["CONTENT_LENGTH"])) {
if ($_SERVER["CONTENT_LENGTH"] > ((int)ini_get('post_max_size') * 1024 * 1024)) {
die('<script type="text/javascript">window.open("some page youre gonna handle the error","_self");</script>');
}
}
关于php - 我怎样才能捕捉到这个错误? (发布内容长度...),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9315461/