---
schema_version: "1"
id: 0cef703fc49c43714f3ff7d2198f6303f71b0d4b7b70c9a2af7962a4b7c576be
title: ConnectApi.BinaryInput
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/apexref/apex_connectapi_input_binary.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_connectapi_input_binary.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 545d270e8a5dbe580abac6ea56a8870b88b20f0c304c5f709fcf83b62d2377ad
description: Create a ConnectApi.BinaryInput object to attach files to feed items and comments, to add repository files, to create managed content, and to replace managed content variants.
---
# ConnectApi.BinaryInput

Create a ConnectApi.BinaryInput object to attach files to feed items and comments, to add repository files, to create managed content, and to replace managed content variants.

The constructor is:

ConnectApi.BinaryInput(blob, contentType, filename)

The constructor takes these arguments:

| Argument | Type | Description | Available Version |
| --- | --- | --- | --- |
| blob | Blob | Contents of the file to be used for input | 28.0 |
| contentType | String | MIME type description of the content, such as image/jpg | 28.0 |
| filename | String | File name with the file extension, such as UserPhoto.jpg | 28.0 |

#### See Also

- [Post a Feed Element with a New File (Binary) Attachment](https://developer.salesforce.com/docs/atlas.en-us.264.0.apexcode.meta/apexcode/connectapi_examples_post_feed_element_binary.htm "Post a Feed Element with a New File (Binary) Attachment - HTML (New Window)")
- [Post a Comment with a New File](https://developer.salesforce.com/docs/atlas.en-us.264.0.apexcode.meta/apexcode/connectapi_examples_post_comment_feed_element_3.htm "Post a Comment with a New File - HTML (New Window)")
- [ConnectApi.BatchInput](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_connectapi_input_batch.htm "Construct a set of inputs to be passed into a method at the same time.")