Send a file to OpenAI API without accessing the file system

How can I send a file to the OpenAI API without accessing the file system? I have the file contents as a string. The provided code in the OpenAI documentation reads a file from the file system, but I want to avoid that step.

Docs: https://platform.openai.com/docs/api-reference/files/upload

I tried this

const readableStream = Readable.from(fileContents);

But it doesn’t work