<commit_before>===========================================
MongoDB\\GridFS\\Bucket::downloadToStream()
===========================================

.. default-domain:: mongodb

.. contents:: On this page
   :local:
   :backlinks: none
   :depth: 1
   :class: singlecol

Definition
----------

.. phpmethod:: MongoDB\\GridFS\\Bucket::downloadToStreamByName()

   Selects a GridFS file by its ``filename`` and copies its contents to a
   writable stream.

   .. code-block:: php

      function downloadToStreamByName($filename, $destination, array $options = []): void

   This method has the following parameters:

   .. include:: /includes/apiargs/MongoDBGridFSBucket-method-downloadToStreamByName-param.rst

   The ``$options`` parameter supports the following options:

   .. include:: /includes/apiargs/MongoDBGridFSBucket-method-downloadToStreamByName-option.rst

.. todo: add examples

Errors/Exceptions
-----------------

.. include:: /includes/extracts/error-gridfs-filenotfoundexception.rst
.. include:: /includes/extracts/error-invalidargumentexception.rst
.. include:: /includes/extracts/error-driver-runtimeexception.rst

See Also
--------

- :phpmethod:`MongoDB\\GridFS\\Bucket::downloadToStream()`
- :phpmethod:`MongoDB\\GridFS\\Bucket::openDownloadStream()`
- :phpmethod:`MongoDB\\GridFS\\Bucket::openDownloadStreamByName()`
<commit_msg>DOCS-10307: Fix title in Bucket::downloadToStreamByName() docs<commit_after>=================================================
MongoDB\\GridFS\\Bucket::downloadToStreamByName()
=================================================

.. default-domain:: mongodb

.. contents:: On this page
   :local:
   :backlinks: none
   :depth: 1
   :class: singlecol

Definition
----------

.. phpmethod:: MongoDB\\GridFS\\Bucket::downloadToStreamByName()

   Selects a GridFS file by its ``filename`` and copies its contents to a
   writable stream.

   .. code-block:: php

      function downloadToStreamByName($filename, $destination, array $options = []): void

   This method has the following parameters:

   .. include:: /includes/apiargs/MongoDBGridFSBucket-method-downloadToStreamByName-param.rst

   The ``$options`` parameter supports the following options:

   .. include:: /includes/apiargs/MongoDBGridFSBucket-method-downloadToStreamByName-option.rst

.. todo: add examples

Errors/Exceptions
-----------------

.. include:: /includes/extracts/error-gridfs-filenotfoundexception.rst
.. include:: /includes/extracts/error-invalidargumentexception.rst
.. include:: /includes/extracts/error-driver-runtimeexception.rst

See Also
--------

- :phpmethod:`MongoDB\\GridFS\\Bucket::downloadToStream()`
- :phpmethod:`MongoDB\\GridFS\\Bucket::openDownloadStream()`
- :phpmethod:`MongoDB\\GridFS\\Bucket::openDownloadStreamByName()`

{'fraction_non_alphanumeric': 0.21075424034644533, 'fraction_numerical': 0.0025261638397690365, 'mean_word_length': 4.259962049335863, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 17, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3228667', 'n_tokens_mistral': 797, 'n_tokens_neox': 764, 'n_words': 151}