diff --git a/components/http_foundation/introduction.rst b/components/http_foundation/introduction.rst index 38389c4f7fb..e2f08c523a4 100644 --- a/components/http_foundation/introduction.rst +++ b/components/http_foundation/introduction.rst @@ -519,6 +519,13 @@ 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 you *just* created the file during this same request, the file *may* be sent + without any content. This may be due to cached file stats that return zero for + the size of the file. To fix this issue, call ``clearstatcache(false, $file)`` + with the path to the binary file. + .. _component-http-foundation-json-response: Creating a JSON Response