0

我正在尝试获取图像的文件大小。如果我上传低于 5 MB 大小的图像,则此函数正在正确计算图像大小。但如果超过图像文件大小,则不计算图像文件!

$size = 文件大小($_FILES['file']['tmp_name']);

我不明白问题是什么。

4

1 回答 1

0

未经测试的代码

 if(empty($_FILES) && empty($_POST) && isset($_SERVER['REQUEST_METHOD']) && strtolower($_SERVER['REQUEST_METHOD']) == 'post'){ //catch file overload error...
        $postMax = ini_get('post_max_size'); //grab the size limits...
        echo "<p style=\"color: #F00;\">\nPlease note files larger than {$postMax} will result in this error!<br>Please be advised this is not a limitation in the CMS, This is a limitation of the hosting server.
        callMyForm(); //bounce back to the just filled out form.
}
elseif(// continue on with processing of the page...
于 2012-10-05T05:58:30.030 回答