【发布时间】:2018-04-14 13:03:14
【问题描述】:
控制器:在这里我想调整存储在另一台服务器上的图像的大小,但在这里我收到权限被拒绝错误。我该如何解决这个问题? 提前致谢。
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();
}
【问题讨论】:
标签: php codeigniter ftp upload resize