diff --git a/http_client.rst b/http_client.rst index 9081ed4df4a..2f8c9eb0c13 100644 --- a/http_client.rst +++ b/http_client.rst @@ -627,6 +627,18 @@ according to the ``multipart/form-data`` content-type. The 'body' => $formData->bodyToIterable(), ]); +By default, :class:`Symfony\\Component\\Mime\\Part\\Multipart\\FormDataPart` +will transfer file uploads in binary encoding. But you can enforce Base64:: + + $fileField = DataPart::fromPath( + path: '/path/to/uploaded/file', + encoding: 'base64' + ); + +.. versionadded:: 6.3 + + The `encoding` parameter was introduced in Symfony 6.3. + .. tip:: When using multidimensional arrays the :class:`Symfony\\Component\\Mime\\Part\\Multipart\\FormDataPart`