Using php 5.4.34 And Laravel 4 with apache 2.2.22 and Ubuntu.
Using the library https://github.com/goodby/csv to parse a csv uploaded.
here is my code :
$file = Input::file('file');
//echo $file->getClientOriginalName();
$config = new LexerConfig();
$config
->setDelimiter(";")
->setToCharset('UTF-8')
;
$lexer = new Lexer($config);
$interpreter = new Interpreter();
$salarie_csv = [];
$errors = [];
$lineNb = 0;
$interpreter->addObserver(function (array $rows) use (&$salarie_csv, &$lineNb, &$errors) {
//some code
});
$lexer->parse($file, $interpreter);
return Response::json($errors, 200);
When I upload a 1.5Mb size csv with 20.000 rows it works.
When I upload a 2.5Mb size csv with 38.500 rows it give me the error :
SplFileObject::__construct():Filename cannot be empty in Lexer.php line 50.
i tried with the same file (just removed or add some rows for the test)
Is there a way to fix this ?