Skip to content

Commit ceb0d85

Browse files
Swimburgergithub-actions[bot]
authored andcommitted
update changelogs
1 parent 2bf4329 commit ceb0d85

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
## 3.9.0
2+
**`(feat):`** Add support for the `Uploadable.FromPath` and `Uploadable.WithMetadata` types to upload files with metadata to multipart-form endpoints.
3+
4+
Users can configure metadata when uploading a file to a multipart-form upload endpoint using the `Uploadable.WithMetadata` type:
5+
```typescript
6+
import { createReadStream } from "fs";
7+
8+
await client.upload({
9+
file: {
10+
data: createReadStream("path/to/file"),
11+
filename: "my-file",
12+
contentType: "audio/mpeg",
13+
},
14+
otherField: "other value",
15+
});
16+
```
17+
The `filename`, `contentType`, and `contentLength` properties are optional.
18+
19+
Alternatively, users can use the `Uploadable.FromPath` type to upload directly from a file path:
20+
```typescript
21+
await client.upload({
22+
file: {
23+
path: "path/to/file",
24+
filename: "my-file",
25+
contentType: "audio/mpeg",
26+
},
27+
otherField: "other value",
28+
});
29+
```
30+
31+
The metadata is used to set the `Content-Type` and `Content-Disposition` headers. If not provided, the client will attempt to determine them automatically.
32+
```
33+
34+

0 commit comments

Comments
 (0)