---
name: "mongoc_gridfs_create_file"
section: "3"
platform: "linux"
package: "libmongoc-doc"
version: "1.30.4-1+deb13u3"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/mongoc_gridfs_create_file"
---

# mongoc\_gridfs\_create\_file(3)

## SYNOPSIS

```
mongoc_gridfs_file_t *
mongoc_gridfs_create_file (mongoc_gridfs_t *gridfs,
                           mongoc_gridfs_file_opt_t *opt);
```

## PARAMETERS

- •

  **gridfs**: A *mongoc\_gridfs\_t*.

- •

  **opt**: A *mongoc\_gridfs\_file\_opt\_t* to specify file options.

## DESCRIPTION

This function shall create a new *mongoc\_gridfs\_file\_t*.

Use *mongoc\_gridfs\_file\_writev()* to write to the file.

## RETURNS

Returns a newly allocated *mongoc\_gridfs\_file\_t* that should be freed with *mongoc\_gridfs\_file\_destroy()*.

## AUTHOR

MongoDB, Inc

## COPYRIGHT

2009-present, MongoDB, Inc.
