Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FileName cannot be empty #47

Open
bastoune opened this issue Nov 24, 2014 · 1 comment
Open

FileName cannot be empty #47

bastoune opened this issue Nov 24, 2014 · 1 comment

Comments

@bastoune
Copy link

Hi,

When I upload some csv file, I get the error SplFileObject::__construct():Filename cannot be empty in Lexer.php line 50.
when I echo $file->getClientOriginalName(), it give me the right name which is just "liste.csv".
In the headers sended, I do have
Content-Disposition: form-data; name="file"; filename="liste.csv"
Content-Type: application/vnd.ms-excel

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);
@bastoune
Copy link
Author

When I limit the number of line to 20.000 it works well, the file is initially 2.5Mb size.
Is there a row number limit/ file size limit ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant