【发布时间】:2023-03-18 09:18:01
【问题描述】:
我想使用 codeigniter 从目录中删除图像..
我已经尝试了很多,但每次它都会抛出警告......那个消息:
unlink(): http 不允许取消链接
我已尝试关注。
请说这其中哪一个是正确的,或者所有的都是错误的?
****/* $f = $this->input->post("imgs"); //this is the file name come from view
$directory1 = "assets/images/";
$paths = base_url().$directory1.$f;
$dest = base_url().$directory1."imgx/".$f;
$rnm =$paths."_deleted_".$this->input->post('ida');
opendir(base_url().directory1);
//echo $paths;
/*if(file_exists($paths))
echo "exists";
else
echo "<img src='".$paths."'>"; echo "not exists"; //shows not exists but load the image
if(unlink($paths)) {
echo 'deleted successfully';
}
else {
echo 'errors occured'; //shows eror occured
}
//exit;
//unlink($paths);
/*@chmod(base_url().'assets/images/'.$f, 0750);
@unlink(base_url().'assets/images/'.$f);*/
//rename($paths,$rnm);*/
如何摆脱这个..plz帮助
【问题讨论】:
标签: php codeigniter unlink