Controller :这里我想调整存储在另一台服务器上的图像的大小,但是这里我得到了权限被拒绝的错误 . 我该如何解决这个问题?提前致谢 .
public function img_r()
{
$image = "https://lh3.googleusercontent.com/omjb1vMWKKK3dvcZKGjHbx_zp-cwOgP7zT4blbLLS1BsIpq7JC8dgRYCXG73Ghwst8QXrSodAEl54vCwljdky06-";
$data = file_get_contents($image);
/*store image in server*/
$new = FCPATH."assets\img";
/*Write the contents back to a new file*/
file_put_contents($new,$data);
$config['image_library'] = 'gd2';
$config['source_image'] = $new;
$config['create_thumb'] = TRUE;
$config['maintain_ratio'] = TRUE;
$config['width'] = 700;
$config['height'] = 450;
$config['new_image'] = FCPATH."assets\uploads".$image;
$config['thumb_marker'] = '_thumb';
$this->load->library('image_lib', $config);
$this->image_lib->resize();
}
3 回答
我认为它的权限问题.Plz给你要存储文件的目录提供写权限 .
也可以把值放到执行0755
这是因为您有权更改文件夹权限 . [/ u920015_ don 't have permission to write that folder Also might be check whether as '用户''您有权更改文件夹权限 .
你可以参考这个:https://www.addictivetips.com/windows-tips/windows-7-access-denied-permission-ownership/
https://forums.iis.net/t/1167645.aspx