I’m using the odan slim4 framework
With the following code fragment in an ActionClass
public function __invoke(ServerRequestInterface $request, ResponseInterface $response): ResponseInterface
{
$uploadedFiles = $request->getUploadedFiles();
$file = $uploadedFiles[0];
$contentType = $file->getClientMediaType();
When the uploaded file has a Content-Type of image/png;base64 my variable $contentType contains image/png, leaving me with no way of determining that the file has been base64 encoded.
Some debugging reveals that the $_FILES array is affected in the same way…
Hi @odan
Oh - my bad. Should have done my research - I just assumed that because the payload (that I do not control) was passing it as part of the Content-Type that it was valid as a Mime-Type. I’ll get back to the authors of the client.
That does leave the question - How does one extract the Content-Transfer-Encoding header? Would it be retrieved by the Streamnterface?