【发布时间】:2016-03-16 04:19:06
【问题描述】:
我的项目使用 xampp 在 localhost 中运行良好,但在远程服务器中,当我尝试上传或更新图像时出现错误,..
警告:
消息:move_uploaded_file(images/1458100947_2.jpg): 无法打开流:权限被拒绝
这是错误所在的代码。
$imagename = $this->person->view($this->input->post('id'))->image;
if(file_exists("images/$imagename")) unlink("images/".$imagename);
$fileName = time(). '_' .$_FILES["image"]["name"];
move_uploaded_file($_FILES["image"]["tmp_name"],$output_dir.$fileName); //this line
$targetPath = 'images/' . $fileName;
$config_resize['image_library'] = 'gd2';
$config_resize['create_thumb'] = FALSE;
$config_resize['maintain_ratio'] = TRUE;
// $config_resize['master_dim'] = 'height';
$config_resize['quality'] = "80%";
$config_resize['source_image'] = $targetPath;
$config_resize['height'] = 600;
$config_resize['width'] = 1024;
// $config_resize['thumb_marker'] = '';
$config_resize['new_image'] = 'images/' . $fileName;
$this->image_lib->initialize($config_resize);
$this->image_lib->resize();
$uploaded = TRUE;
我正在尝试 google 如何在 codeigniter 中将权限设置为 777,但没有运气。这是我的项目链接 http://mysports.orgfree.com。使用此管理员帐户。
用户名:mak 密码:mak
登录并单击编辑按钮,然后上传一些图像.. 之后将显示错误.. 谢谢...
【问题讨论】:
标签: codeigniter