You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]}
2350
2373
"401":
2351
2374
application/json: {"errors": [{"code": 1001, "message": "User could not be authenticated", "status": 401}, {"code": 1001, "message": "User could not be authenticated", "status": 401}]}
-[`logLogLine`](docs/sdks/log/README.md#logline) - Logging a single line message.
555
564
-[`logLogMultiLine`](docs/sdks/log/README.md#logmultiline) - Logging a multi-line message
@@ -604,6 +613,42 @@ To read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md).
604
613
</details>
605
614
<!-- End Standalone functions [standalone-funcs] -->
606
615
616
+
<!-- Start File uploads [file-upload] -->
617
+
## File uploads
618
+
619
+
Certain SDK methods accept files as part of a multi-part request. It is possible and typically recommended to upload files as a stream rather than reading the entire contents into memory. This avoids excessive memory consumption and potentially crashing with out-of-memory errors when working with very large files. The following example demonstrates how to attach a file stream to a request.
620
+
621
+
> [!TIP]
622
+
>
623
+
> Depending on your JavaScript runtime, there are convenient utilities that return a handle to a file without reading the entire contents into memory:
624
+
>
625
+
> -**Node.js v20+:** Since v20, Node.js comes with a native `openAsBlob` function in [`node:fs`](https://nodejs.org/docs/latest-v20.x/api/fs.html#fsopenasblobpath-options).
626
+
> -**Bun:** The native [`Bun.file`](https://bun.sh/docs/api/file-io#reading-files-bun-file) function produces a file handle that can be used for streaming file uploads.
627
+
> -**Browsers:** All supported browsers return an instance to a [`File`](https://developer.mozilla.org/en-US/docs/Web/API/File) when reading the value from an `<input type="file">` element.
628
+
> -**Node.js v18:** A file stream can be created using the `fileFrom` helper from [`fetch-blob/from.js`](https://www.npmjs.com/package/fetch-blob).
0 commit comments