我正在使用 codeigniter 2。当使用 unlink() php 函数时,它会抛出错误。这是我在 CI 中删除文件的模型函数:
function delete($file)
{
$delete_files = $this->gallery_path_url.$file;
if(!empty($delete_files)) {
unlink($delete_files);
}
}
点击删除链接时,显示警告:
unlink() [function.unlink]: http 不允许取消链接
是否有取消链接的替代功能以避免警告
最佳答案
您正在尝试使用类似 http://thing/I/want/deleted
的地址删除文件。你不可以做这个。而是使用像 /path/to/file/on/my/computer/
关于php - CI 中的取消链接函数抛出警告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8722780/