Skip to content

Commit b785d35

Browse files
committed
Merge branch '2.8'
* 2.8: Adding information about empty files sent using BinaryFileResponse.
2 parents 9569e2d + 676c75f commit b785d35

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

components/http_foundation/introduction.rst

+7
Original file line numberDiff line numberDiff line change
@@ -519,6 +519,13 @@ It is possible to delete the file after the request is sent with the
519519
:method:`Symfony\\Component\\HttpFoundation\\BinaryFileResponse::deleteFileAfterSend` method.
520520
Please note that this will not work when the ``X-Sendfile`` header is set.
521521

522+
.. note::
523+
524+
If you *just* created the file during this same request, the file *may* be sent
525+
without any content. This may be due to cached file stats that return zero for
526+
the size of the file. To fix this issue, call ``clearstatcache(false, $file)``
527+
with the path to the binary file.
528+
522529
.. _component-http-foundation-json-response:
523530

524531
Creating a JSON Response

0 commit comments

Comments
 (0)