---
name: "mongoc_gridfs_file_set_content_type"
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_file_set_content_type"
---

# mongoc\_gridfs\_file\_set\_content\_type(3)

## SYNOPSIS

```
void
mongoc_gridfs_file_set_content_type (mongoc_gridfs_file_t *file,
                                     const char *content_type);
```

## PARAMETERS

- •

  **file**: A *mongoc\_gridfs\_file\_t*.

- •

  **str**: A string containing the content type.

## DESCRIPTION

Sets the content type for the gridfs file. This should be something like **"text/plain"**.

You need to call *mongoc\_gridfs\_file\_save()* to persist this change.

## AUTHOR

MongoDB, Inc

## COPYRIGHT

2009-present, MongoDB, Inc.
