## MedplumClient.createBinary() method
Creates a FHIR `Binary` resource with the provided data content.

The return value is the newly created resource, including the ID and meta.

The `data` parameter can be a string or a `File` object.

A `File` object often comes from a `<input type="file">` element.

**Signature:**

```typescript
createBinary(createBinaryOptions: CreateBinaryOptions, requestOptions?: MedplumRequestOptions): Promise<WithId<Binary>>;
```

## Parameters

| Parameter                | Type                                                             | Description                                                                                                                                                    |
|--------------------------|------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------|
| createBinaryOptions      | [CreateBinaryOptions](/content/docs/sdk/core.createbinaryoptions) | The binary options. See `CreateBinaryOptions` for full details.                                                                                            |
| requestOptions           | [MedplumRequestOptions](/content/docs/sdk/core.medplumrequestoptions) | _(Optional)_ Optional fetch options. **NOTE:** only `options.signal` is respected when `onProgress` is also provided.                                       |

**Returns:**  
Promise< [WithId](/content/docs/sdk/core.withid) <Binary>>

The result of the create operation.

## Example
Example:

```typescript
const result = await medplum.createBinary(myFile, 'test.jpg', 'image/jpeg');

console.log(result.id);
```

See the [FHIR "create" operation](https://www.hl7.org/fhir/http.html#create) for full details.
