@@ -183,9 +183,8 @@ information in an options array, which you can pass as a parameter.
183
183
184
184
This example performs the following actions:
185
185
186
- - Calls the ``fopen()`` method to create a temporary memory-based stream
187
- that you can write to and read from
188
- - Calls the ``fwrite()`` method to write data to the stream
186
+ - Calls the ``fopen()`` method to open a file located at ``/path/to/file``
187
+ as a stream in binary read (``rb``) mode
189
188
- Calls the ``uploadFromStream()`` method to upload the contents of the stream
190
189
to a GridFS file named ``'new_file'``
191
190
@@ -320,7 +319,9 @@ method, which takes the ``_id`` field of a file as a parameter:
320
319
stream needs to pull a chunk from MongoDB, it pulls the entire chunk
321
320
into memory. The 255-kilobyte default chunk size is usually
322
321
sufficient, but you can reduce the chunk size to reduce memory
323
- overhead.
322
+ overhead or increase the chunk size when working with larger files.
323
+ For more information about setting the chunk size, see the
324
+ :ref:`gridfs-create-custom-bucket` section of this page.
324
325
325
326
Download a File Revision
326
327
~~~~~~~~~~~~~~~~~~~~~~~~
@@ -355,8 +356,9 @@ on your bucket.
355
356
356
357
This example performs the following actions:
357
358
358
- - Calls the ``fopen()`` method to open a download stream
359
- - Downloads a file that has an ``_id`` value of ``ObjectID('66e0a5487c880f844c0a32b1')``
359
+ - Calls the ``fopen()`` method to open a file located at ``/path/to/output-file``
360
+ as a stream in binary write (``wb``) mode
361
+ - Downloads a GridFS file that has an ``_id`` value of ``ObjectID('66e0a5487c880f844c0a32b1')``
360
362
to the stream
361
363
362
364
.. literalinclude:: /includes/write/gridfs.php
0 commit comments