如果存储有很多文件夹,Livewire 图像上传会中断

问题描述

我在 Livewire 中上传文件时遇到问题。 我基本上使用的设置来自:https://laravel-livewire.com/docs/2.x/file-uploads

似乎是什么问题: 如果存储文件夹很大,Livewire 图像上传事件未正确触发。 (23GB)

我有文件上传的输入,我将模型/变量图像 [ ] 连接到它。

<label for="images" class="text-center relative cursor-pointer bg-white rounded-md font-medium text-indigo-600 hover:text-indigo-500 focus-within:outline-none focus-within:ring-2 focus-within:ring-offset-2 focus-within:ring-indigo-500">
<p>Upload images</p>
<input id="images" name="images[]" multiple type="file" class="sr-only" wire:model="images">
</label>

在我的 Livewire 组件中,我正确设置了所有内容我有 WithFileUploads 特征,并且我有一个函数,如果我上传图像,应该触发:(因为模型是图像 [] ->函数已更新Images())

 public function updatedImages()
  {
    $this->validate(['images.*' => 'image|max:4096']);
    //Do stuff for saving
    $this->emit('refreshImages'); //refresh images shown
    }

现在,如果我的存储文件夹是空的,一切正常!。 我得到我的临时文件 uptadedImages() 被触发并保存文件

但是,如果我将设置中的图像(包含 23GB 图像的文件夹结构)粘贴到我的存储文件夹中,图像上传会中断

临时文件已创建,但任何时候都不会触发updatedImages()函数。 此外,它保持在加载状态,我用它来显示

<div wire:loading wire:target="images">Loading ...</div>

为了我的程序的功能,我将临时文件文件夹移动到 config/livewire.PHP 中的 /storage/app

return [
    'temporary_file_upload' => [

        'rules' => 'image|max:102400',// (100MB max,and only pngs,jpegs,and pdfs.)

        'directory' => '/',],];

有没有人遇到过这种类型的问题? 我错过了什么吗? 任何提示将不胜感激! :)

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)