I have a frontend that allows users to upload a file which then gets sent to my Node/Express server in a multipart form.
I am using multer to parse the file from the request but I can’t pass it to OpenAI without error. I have it set to save the file in storage and then I pass the file path into the request and it returns with an error.
The error I get is "Request failed with status code 400"
I have tried this same code without reading the file from the request, but reading it from a locally stored file and it works fine. So I know there isn’t an authentication issue.
@curt.kennedy I can get the Buffer from the multer middleware. I’ve tried sending just the buffer but that didn’t work either. Is there something else I could do with the Buffer?
Here is a quick simple Python version I coded after the announcement. Works out of the gate in an AWS Lambda environment (just add a requests layer and path to the actual file). The memory version using a BytesIO object would be similar. Haven’t tried any JavaScript versions myself.