如何取消链接具有www数据所有权的文件? [Laravel]

时间:2019-02-18 07:17:10

标签: laravel file permissions unlink ownership

我在/ public / images /目录中有文件。它不允许我从目录取消链接文件。

1 个答案:

答案 0 :(得分:0)

尝试

if(file_exists($data->location)) { 
  unlink($data->location); 
  // this path should be public_path() not the url site path
}

Note :-取消链接功能允许公共或存储路径不允许站点或URL路径取消链接。

例如

允许此路径:

C:\ xampp \ htdocs \ laravel \ public

不允许此路径:

http://localhost/laravel/public