@@ -152,6 +152,8 @@ You can upload files to a GridFS bucket by using the following methods:
152
152
- ``MongoDB\GridFS\Bucket::uploadFromStream()``: Uploads the contents of
153
153
an existing stream to a GridFS file
154
154
155
+ .. _gridfs-open-upload-stream:
156
+
155
157
Write to an Upload Stream
156
158
~~~~~~~~~~~~~~~~~~~~~~~~~
157
159
@@ -183,7 +185,7 @@ information in an options array, which you can pass as a parameter.
183
185
184
186
This example performs the following actions:
185
187
186
- - Calls the ``fopen()`` method to open a file located at ``/path/to/file ``
188
+ - Calls the ``fopen()`` method to open a file located at ``/path/to/input_file ``
187
189
as a stream in binary read (``rb``) mode
188
190
- Calls the ``uploadFromStream()`` method to upload the contents of the stream
189
191
to a GridFS file named ``'new_file'``
@@ -219,7 +221,7 @@ Example
219
221
220
222
The following code example shows you how to retrieve and print file metadata
221
223
from files in a GridFS bucket. It uses a ``foreach`` loop to iterate through
222
- the returned cursor and display the contents of the file uploaded in the
224
+ the returned cursor and display the contents of the files uploaded in the
223
225
:ref:`gridfs-upload-files` examples:
224
226
225
227
.. io-code-block::
@@ -279,7 +281,7 @@ create a download stream.
279
281
This example uses a download stream to perform the following actions:
280
282
281
283
- Selects a GridFS file named ``'my_file'``, uploaded in the
282
- :ref:`gridfs-upload-files ` example, and opens it as a readable stream
284
+ :ref:`gridfs-open- upload-stream ` example, and opens it as a readable stream
283
285
- Calls the ``stream_get_contents()`` method to read the contents of ``'my_file'``
284
286
- Prints the file contents
285
287
- Calls the ``fclose()`` method to close the download stream pointing to ``'my_file'``
@@ -356,7 +358,7 @@ on your bucket.
356
358
357
359
This example performs the following actions:
358
360
359
- - Calls the ``fopen()`` method to open a file located at ``/path/to/output-file ``
361
+ - Calls the ``fopen()`` method to open a file located at ``/path/to/output_file ``
360
362
as a stream in binary write (``wb``) mode
361
363
- Downloads a GridFS file that has an ``_id`` value of ``ObjectID('66e0a5487c880f844c0a32b1')``
362
364
to the stream
0 commit comments