<?xml version="1.0"?>
<page xmlns="http://projectmallard.org/1.0/"
      type="topic"
      style="function"
      xmlns:api="http://projectmallard.org/experimental/api/"
      xmlns:ui="http://projectmallard.org/experimental/ui/"
      id="mongoc_gridfs_create_file_from_stream">
  <info>
    <link type="guide" xref="mongoc_gridfs_t" group="function"/>
  </info>
  <title>mongoc_gridfs_create_file_from_stream()</title>

  <section id="synopsis">
    <title>Synopsis</title>
    <synopsis><code mime="text/x-csrc"><![CDATA[mongoc_gridfs_file_t *
mongoc_gridfs_create_file_from_stream (mongoc_gridfs_t          *gridfs,
                                       mongoc_stream_t          *stream,
                                       mongoc_gridfs_file_opt_t *opt);
]]></code></synopsis>
  </section>


  <section id="parameters">
    <title>Parameters</title>
    <table>
      <tr><td><p>gridfs</p></td><td><p>A <link xref="mongoc_gridfs_t">mongoc_gridfs_t()</link>.</p></td></tr>
      <tr><td><p>stream</p></td><td><p>A <link xref="mongoc_stream_t">mongoc_stream_t</link>.</p></td></tr>
      <tr><td><p>opt</p></td><td><p>A <link xref="mongoc_gridfs_file_opt_t">mongoc_gridfs_file_opt_t</link> to specify file options.</p></td></tr>
    </table>
  </section>

  <section id="description">
    <title>Description</title>
    <p>This function shall create a new <link xref="mongoc_gridfs_file_t">mongoc_gridfs_file_t</link> and fill it with the contents of <code>stream</code>. Note that this function will read from <code>stream</code> until End of File, making it bet suited for file-backed streams.</p>
  </section>

  <section id="return">
    <title>Returns</title>
    <p>A newly allocated <link xref="mongoc_gridfs_file_t">mongoc_gridfs_file_t</link> that should be freed with <link xref="mongoc_gridfs_file_destroy">mongoc_gridfs_file_destroy()</link> when no longer in use.</p>
  </section>

</page>
