Skip to content
Open
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions http_client.rst
Original file line number Diff line number Diff line change
Expand Up @@ -627,6 +627,17 @@ 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`
Expand Down