【问题标题】:Laravel allFiles() error glob Pattern exceeds the maximum allowed length of 260 charactersLaravel allFiles() 错误 glob Pattern 超出最大允许长度 260 个字符
【发布时间】:2017-05-27 20:38:03
【问题描述】:

你好我有这个功能

$files=File::allFiles(base_path('folder/'));

在这个文件夹中有子文件夹,当我尝试获取文件时它返回

error glob Pattern exceeds the maximum allowed length of 260 characters

我知道这是因为子文件夹字符是 280 字符,但我该如何解决呢? 我研究过,但没有找到任何解决方案。

【问题讨论】:

  • 这是文件名长度的限制。仅供参考,大多数文件名不能超过 255 个字符。在你的情况下,你需要循环。
  • 好的,我需要使用循环好的,谢谢!

标签: php laravel


【解决方案1】:

/ 之后您缺少报价:

$files=File::allFiles(base_path('folder/));

应该是:

$files=File::allFiles(base_path('folder/'));

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-11-15
    • 1970-01-01
    • 1970-01-01
    • 2011-02-02
    • 1970-01-01
    相关资源
    最近更新 更多