# July 17, 2025

## 2.5.0

**`(feat):`** Support uploading file-like types for binary upload endpoints (not multipart-form):

* Buffered types: `Buffer`, `Blob`, `File`, `ArrayBuffer`, `ArrayBufferView`, and `Uint8Array`
* Stream types: `fs.ReadStream`, `stream.Readable`, and `ReadableStream`

**`(feat):`** Users can configure metadata when uploading a file to a binary upload endpoint using the `Uploadable.WithMetadata` type:

```typescript
import { createReadStream } from "fs";

await client.upload({
    data: createReadStream("path/to/file"),
    filename: "my-file",
    contentType: "audio/mpeg",
    contentLength: 1949,
});
```

The `filename`, `contentType`, and `contentLength` properties are optional.

Alternatively, users can use the `Uploadable.FromPath` type to upload directly from a file path:

```typescript
await client.upload({
    path: "path/to/file",
    filename: "my-file",
    contentType: "audio/mpeg",
    contentLength: 1949,
});
```

The metadata is used to set the `Content-Length`, `Content-Type`, and `Content-Disposition` headers. If not provided, the client will attempt to determine them automatically.
For example, `fs.ReadStream` has a `path` property which the SDK uses to retrieve the file size from the filesystem without loading it into memory:

```typescript
import { createReadStream } from "fs";

await client.upload(createReadStream("path/to/file"));
```