Php Codeigniter上载库用于验证图像的最小宽度和最小高度

Php Codeigniter上载库用于验证图像的最小宽度和最小高度,php,codeigniter,Php,Codeigniter,我正在使用codeigniter中的上载库上载图像 $config[‘allowed_types’] = ‘gif|png|jpg’; $config[‘max_size’] = ‘1000’; $config[‘max_width’] = ‘200’; $config[‘max_heigth’] = ‘200’; $config[‘upload_path’] = ‘./uploads/’ $this->load->library(‘uplo

我正在使用codeigniter中的上载库上载图像

$config[‘allowed_types’]    = ‘gif|png|jpg’;
$config[‘max_size’]      = ‘1000’;
$config[‘max_width’]      = ‘200’;
$config[‘max_heigth’]      = ‘200’;
$config[‘upload_path’]    = ‘./uploads/’
$this->load->library(‘upload’, $config);
用户上传图像时……。用户应上传最小宽度和最小高度

对于这个怎么办

CI只有最大宽度和最大高度…。。。。。。我也知道这个功能

 getimagesize();

但要使用此函数,我们需要源图像url。。。我没有访问权限

要执行此操作,请使用下一段代码:

$data = $this->upload->data();
list($width, $height) = getimagesize($data['full_path']);

在上传文件之前,您应该使用JavaScript确定文件的大小,因为PHP不能这样做,因为它是服务器端而不是客户端。

要做到这一点,请使用下一段代码:

$data = $this->upload->data();
list($width, $height) = getimagesize($data['full_path']);

您应该在上传文件之前使用JavaScript来确定文件大小,因为PHP不能这样做,因为它是服务器端而不是客户端。

上传之前或之后?上传之前或之后?您好,感谢您的回答,但这将给出上传后的大小。我需要在上传前验证图像。使用客户端语言,如javascript。您应该了解服务器端无法测量客户端的映像端;)您好,谢谢您的回答,但这将给出上传后的大小。我需要在上传前验证图像。使用客户端语言,如javascript。您应该了解服务器端无法测量客户端的映像端;)