Symfony UploadedFile guessClientExtension vs guessExtension

  file-upload, image-upload, javascript, symfony, symfony4

Uploading a file from a ReactJS/Javascript front end App to a Symfony 4 Backend, I try to get its file extension.

With the file received, I instanciate an UploadedFile object, so from which I can use the methods :


I would expect those getters to return consistent results but it is not really what happens.
Return results for an uploaded file with named 'image-ile.jpg' are :

getClientOriginalExtension : '',
getClientMimeType : application/octet-stream,
guessClientExtension : bin,
guessExtension : jpeg,

Image file is sent using javascript FormData, with Content-Type : multipart/form-data :

Content-Disposition: form-data; name="image-ile.jpg"; filename="image-ile.jpg"
Content-Type: image/jpeg

My question is :
In my case, the guessClientExtension doesn’t return the relevant file extension while the guessExtension does. So in which cases should I use one getter instead of the other one ?

Source: Symfony Questions