feof error when uploading file with Symfony HTTP Client #51360
Replies: 2 comments
-
For anyone coming across this thread after Googling the same issue, I found a workaround. Take a look at the HTTP Client version 6.2 docs for an alternative (and slightly more long-winded) way to upload files inside a request body. The relevant code snippet involves the use of the Would still appreciate any input that sheds some light on the original issue! |
Beta Was this translation helpful? Give feedback.
{{title}}
{{editor}}'s edit
{{editor}}'s edit
-
I managed to reproduce the issue: it comes from the Opened #51366. |
Beta Was this translation helpful? Give feedback.
{{title}}
-
I'm using Symfony 6.3 with PHP 8.2 on macOS and trying to upload a file using Symfony's HTTP client:
However, running this code is causing a
TransportException
with the message:The exception in question is being raised in line 384 of
Symfony\Component\HttpClient\HttpClientTrait
as follows:It seems like the end-of-file test is returning
true
for some reason, however if I add the following line directly before I create the request in the code above, it is outputtingbool(false)
:Any other checks for file validity (such as
file_exists
andis_readable
on the path) are confirming that the file path is definitely correct!I am well and truly stumped, and wondered if anyone here could give me any advice on how to overcome this issue please?
Beta Was this translation helpful? Give feedback.
All reactions