FilamentF
Filament6mo ago
Ryuuji

How can I set a file to FileUpload input when editing?

I'm creating a form that has a FileUpload input but when i want to edit it, how should I pass the existing file? i tried this but it didn't work
(I'm not using the panel component)
  public function mount(): void
    {
        $path = Storage::disk('local')->path('uploaded.jpeg');
        $this->form->fill([
            'file' => $path,
        ]);
    }
Solution
So you should just render the path as it was stored by the file upload field... You shouldn't need to use the Storage disk since the plugin handles all that
Was this page helpful?