Β© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filamentβ€’3y agoβ€’
9 replies
SirAlyon

Error in Filament's ImportAction Feature

Hello everyone! I'm encountering an issue with Filament's new ImportAction feature, and I've updated Filament to version 3.1 to utilize this functionality. I've generated a test importer using the automatic class generation. Everything appears to be functioning correctly until I attempt to upload a file. After the upload, I encounter the following error:
fgetcsv(): Read of 8192 bytes failed with errno=21 Is a directory.
fgetcsv(): Read of 8192 bytes failed with errno=21 Is a directory.

I'm unsure about where to begin debugging this error. Any advice or insights would be greatly appreciated.
Below is the relevant code snippet:


My Resource:
public static function table(Table $table): Table
    {
        return $table
        ->headerActions([
            ImportAction::make()
                ->importer(KiidMailPdfImporter::class)
        ])
     ...other code
    }
public static function table(Table $table): Table
    {
        return $table
        ->headerActions([
            ImportAction::make()
                ->importer(KiidMailPdfImporter::class)
        ])
     ...other code
    }


My Importer:
namespace App\Filament\Imports;

use App\Models\KiidMailPdf;
use Filament\Actions\Imports\ImportColumn;
use Filament\Actions\Imports\Importer;
use Filament\Actions\Imports\Models\Import;

class KiidMailPdfImporter extends Importer
{
    protected static ?string $model = KiidMailPdf::class;

    public static function getColumns(): array
    {
        return [
            ImportColumn::make('cstato')
                ->rules(['max:1']),
            ImportColumn::make('tuts')
                ->rules(['datetime']),
            ImportColumn::make('cisin')
                ->rules(['max:50']),

            ...other ImportColumn
        ];
    }

    ...other generated code
namespace App\Filament\Imports;

use App\Models\KiidMailPdf;
use Filament\Actions\Imports\ImportColumn;
use Filament\Actions\Imports\Importer;
use Filament\Actions\Imports\Models\Import;

class KiidMailPdfImporter extends Importer
{
    protected static ?string $model = KiidMailPdf::class;

    public static function getColumns(): array
    {
        return [
            ImportColumn::make('cstato')
                ->rules(['max:1']),
            ImportColumn::make('tuts')
                ->rules(['datetime']),
            ImportColumn::make('cisin')
                ->rules(['max:50']),

            ...other ImportColumn
        ];
    }

    ...other generated code


Thank you.. πŸ™‚
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel β€’ Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Define disk in filament ImportAction
FilamentFFilament / β“β”Šhelp
11mo ago
Handling static fields in the ImportAction feature.
FilamentFFilament / β“β”Šhelp
3y ago
Error in ImportCsv Job using ImportAction
FilamentFFilament / β“β”Šhelp
3y ago
LazyCollection in ImportAction?
FilamentFFilament / β“β”Šhelp
15mo ago