Кемеровские программисты php общаются здесь
Anonymous
Как сделать асинхронную множественную загрузку файлов с индикатором выполнения в laravel
Сообщение
Anonymous » 26 янв 2025, 18:17
У меня возникла проблема: во время загрузки файла не отображается индикатор выполнения. и у меня также есть проблема: во время процесса загрузки файлов я не могу добавить больше файлов, которые хочу загрузить. как я могу это решить? Кстати, я использую livewire для своего приложения на Laravel
это мое мнение:
Код: Выделить всё
Upload Files
@if (session()->has('success'))
{{ session('success') }}
@endif
class="relative border-2 border-dashed border-neutral-600 rounded-lg p-6 flex flex-col items-center justify-center transition hover:bg-neutral-700">
[i] class="absolute inset-0 opacity-0 cursor-pointer z-10">
[/i]
Drop your file here or
browse
Only SVG, PNG, JPG, and MP4 are allowed.
@error('files.*')
{{ $message }}
@enderror
@if ($files)
Files to Upload:
[list]
@foreach ($files as $index => $file)
[*]
{{ $file->getClientOriginalName() }}
{{ round($file->getSize() / 1024, 2) }} KB
d="M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25Zm-1.72 6.97a.75.75 0 1 0-1.06 1.06L10.94 12l-1.72 1.72a.75.75 0 1 0 1.06 1.06L12 13.06l1.72 1.72a.75.75 0 1 0 1.06-1.06L13.06 12l1.72-1.72a.75.75 0 1 0-1.06-1.06L12 10.94l-1.72-1.72Z"
clip-rule="evenodd" />
@endforeach
[/list]
@endif
Upload Files
Uploading files, please
wait...
а это мой контроллер:
Код: Выделить всё
Подробнее здесь: [url]https://stackoverflow.com/questions/79388301/how-to-make-asychronous-multiple-upload-files-with-progress-bar-in-laravel[/url]
1737904649
Anonymous
У меня возникла проблема: во время загрузки файла не отображается индикатор выполнения. и у меня также есть проблема: во время процесса загрузки файлов я не могу добавить больше файлов, которые хочу загрузить. как я могу это решить? Кстати, я использую livewire для своего приложения на Laravel это мое мнение: [code] Upload Files @if (session()->has('success')) {{ session('success') }} @endif class="relative border-2 border-dashed border-neutral-600 rounded-lg p-6 flex flex-col items-center justify-center transition hover:bg-neutral-700"> [i] class="absolute inset-0 opacity-0 cursor-pointer z-10"> [/i] Drop your file here or browse Only SVG, PNG, JPG, and MP4 are allowed. @error('files.*') {{ $message }} @enderror @if ($files) Files to Upload: [list] @foreach ($files as $index => $file) [*] {{ $file->getClientOriginalName() }} {{ round($file->getSize() / 1024, 2) }} KB d="M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25Zm-1.72 6.97a.75.75 0 1 0-1.06 1.06L10.94 12l-1.72 1.72a.75.75 0 1 0 1.06 1.06L12 13.06l1.72 1.72a.75.75 0 1 0 1.06-1.06L13.06 12l1.72-1.72a.75.75 0 1 0-1.06-1.06L12 10.94l-1.72-1.72Z" clip-rule="evenodd" /> @endforeach [/list] @endif Upload Files Uploading files, please wait... [/code] а это мой контроллер: [code] Подробнее здесь: [url]https://stackoverflow.com/questions/79388301/how-to-make-asychronous-multiple-upload-files-with-progress-bar-in-laravel[/url]