kohana3.0如何完全删除图像文件? [英] kohana3.0 how to completely delete image file?
问题描述
我有一个kohana3.0内容和文件管理系统,当用户删除图像时,我希望能够从数据库以及上载图像的文件夹中完全删除图像.现在,我用于图像删除:
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.
如何在kohana 3.0中删除图像文件?
How can an image file be deleted in kohana 3.0?
推荐答案
我对kohana一无所知,但是unlink()函数是如何在PHP中删除文件的.如果这不起作用,则可能是这些文件存在权限问题.
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.
这篇关于kohana3.0如何完全删除图像文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!