I'm unable to use streams based on php://temp to upload files, which results in an OpenAI\Exceptions\ErrorException being thrown with the message The browser (or proxy) sent a request that this server could not understand.
However, I am able to use regular files in the upload files API.
For my use case, I'd like to avoid writing an on-disk file, and therefore would like to have the ability to upload a php://temp file.
Steps To Reproduce
Running the following code will help reproduce the error:
Description
I'm unable to use streams based on
php://temp
to upload files, which results in anOpenAI\Exceptions\ErrorException
being thrown with the messageThe browser (or proxy) sent a request that this server could not understand
.However, I am able to use regular files in the upload files API.
For my use case, I'd like to avoid writing an on-disk file, and therefore would like to have the ability to upload a
php://temp
file.Steps To Reproduce
Running the following code will help reproduce the error:
Changing the above code to the following, and saving the content of the file in a
batch.json
file resolves the issue:OpenAI PHP Client Version
v0.10.2
PHP Version
8.3.6
Notes
No response