Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

qTylok's avatar

Import data with ExcelImport from a extern path

Hi, how can I export something from an external path to excel? I get an error like that Maatwebsite\Excel\Exceptions\NoTypeDetectedException: No ReaderType or WriterType could be detected. Make sure you either pass a valid extension to the filename or pass an explicit type. in file /var/www/html/vendor/maatwebsite/excel/src/Helpers/FileTypeDetector.php on line 31 My code

$path = 'https://test.ro/public/test.csv';

       dd(Excel::import(new ProductsImportData(), $request->path($path)));
0 likes
1 reply
Nakov's avatar

You will need to download the file first, you cannot import from an external URL. So something like this might work:

$contents = file_get_contents('https://test.ro/public/test.csv');
Storage::disk('local')->put('test.csv', $contents);

dd(Excel::import(new ProductsImportData(), storage_path('test.csv')));

Please or to participate in this conversation.