php - CI 中的取消链接函数抛出警告

标签 php codeigniter

我正在使用 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/

相关文章:

php - 为什么我收到 400 错误请求?

php - 重启后前往 URL

php - 如何在文件夹包含的每个HTML文件中包含单独的头文件?

php - Laravel Tinker 在第一个命令后立即退出

php - 不能在写上下文中使用方法返回值

php - 调用未定义的方法 UserModel::addUser()

php - Mysqli 弄乱了我的 while 循环

php - 使用ajax post方法的变量不起作用

codeigniter - 如何在Windows Azure上重写Codeigniter的index.php

Php:设置 cookie 属性 SameSite=None 的 header ;Secure 根本不起作用