From 9c346e0a73ed70acc8be488705734ee1ec4d11b3 Mon Sep 17 00:00:00 2001 From: Kevin Herrera Date: Sun, 31 May 2015 21:30:25 -0700 Subject: [PATCH] Adding information about empty files sent using BinaryFileResponse. --- components/http_foundation/introduction.rst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/components/http_foundation/introduction.rst b/components/http_foundation/introduction.rst index 73187523f3f..134b929296e 100644 --- a/components/http_foundation/introduction.rst +++ b/components/http_foundation/introduction.rst @@ -517,6 +517,14 @@ It is possible to delete the file after the request is sent with the :method:`Symfony\\Component\\HttpFoundation\\BinaryFileResponse::deleteFileAfterSend` method. Please note that this will not work when the ``X-Sendfile`` header is set. +.. note:: + + If a file is created in the same request as when the ``BinaryFileResponse`` + is sent, the file may be sent without any content. This may be due to cached + file stats returning zero for the size of the file. To fix this issue, you + will need to call ``clearstatcache(false, $file)`` with the path to the + binary file. + .. _component-http-foundation-json-response: Creating a JSON Response