kohana3.0 how to completely delete image file?

不问归期 提交于 2019-12-02 11:24:18

问题


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:


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.



来源:https://stackoverflow.com/questions/5938742/kohana3-0-how-to-completely-delete-image-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!