kohana3.0 how to completely delete image file?

2020-04-20 21:22发布

I have a kohana3.0 content and files management system, and I would like to be able to completely delete images from database, and from my folder where I have uploaded them, when a user deletes an image. Now I use for image deletion:

 public function delete($id = NULL)
{
    parent::delete($id);
    unlink($this->path);
}

this in the image model. But it doesn't actually delete my image at all.

How can an image file be deleted in kohana 3.0?

1条回答
够拽才男人
2楼-- · 2020-04-20 21:55

I have no idea about kohana, but the unlink() function is how files are deleted in PHP. If this isn't working, it is possible you just have a permissions problem with those files.

查看更多
登录 后发表回答