Symfony: The temp file does not exist after sumbiting form
Asked Answered
U

0

6

I am using Symfony 2.7 and I have a form that process excel file. When I try to intentionally create form error (or when I catch any error and create form error - I mean to show my error message in the form) after reload of page (I think it's that moment) this happens:

request.CRITICAL: Uncaught PHP Exception Symfony\Component\HttpFoundation\File\Exception\FileNotFoundException: "The file "/tmp/phpFoVva0" does not exist" at .../vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/File/MimeType/MimeTypeGuesser.php line 123 {"exception":"[object] (Symfony\\Component\\HttpFoundation\\File\\Exception\\FileNotFoundException(code: 0): The file \"/tmp/phpFoVva0\" does not exist at .../vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/File/MimeType/MimeTypeGuesser.php:123)"} []

Form code is normally processed but when it finishes or ends with form error this exceptions pops out. The access rights are not problem. The file in error is not the temp file of excel that is in the process. It's some .tmp that is processed in the background.

I noticed that this error pops only in specific situation. In the project and page I have Agency that has Acquisitions (that is what I try to import with that form) and Projects. When I try to import it in agency that has no projects, everything is fine and form error is shown or it's successful. But when I import it in agency that has at least one Project this exception pops.

All forms are registered via .yml config and are initiated in the Controller like this:

$importAcquisitionBudgetType = $this->get("app.form_excel.import_acquisitions_budget_type");
$importAcquisitionBudgetType->setAgency($agency);

$acquisitionsBudgetForm = $this->createForm($importAcquisitionBudgetType);
$acquisitionsBudgetForm->handleRequest($request);

I'm out of any options so every advice would be very apreciated.

Thanks a lot.

Universalist answered 19/1, 2018 at 16:1 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.