开发者

kohana3.0 how to completely delete image file?

开发者 https://www.devze.com 2023-03-05 02:08 出处:网络
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 ima

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);
开发者_Python百科}

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?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号