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

问题描述 投票:1回答:1

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

laravel file permissions unlink ownership
1个回答
0
投票

试试这个:

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

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

例如:

允许此路径:

C:\ XAMPP \ htdocs中\ laravel \公

不允许这条路径:

http://localhost/laravel/public

© www.soinside.com 2019 - 2024. All rights reserved.