Discussions

Ask a Question
Back to All

How to upload multiple files with PHP and Guzzle?

hello all,

is it not possible to upload multiple files at the same time?

here i try it
'$files = $client->request('POST','https://api.personio.de/v1/recruiting/applications/documents', [
'headers' => [
'X-Company-ID' => 'xxxxx',
'accept' => 'application/json',
'authorization' => 'Bearer xxxxx',
],
'multipart' => [
[
'name' => 'cv',
'filename' => $fileName2,
'contents' => fopen($file1, 'r')
],
[
'name' => 'other',
'filename' => $fileName2,
'contents' => fopen($file2, 'r')
],
]
]);'

only the following comes back:

'{"extension":"pdf","mimetype":"application/pdf","original_filename":"xxx.pdf","uuid":"f4d5cbc3-28ff-45df-8282-fae6b933d291","size":122030}'

best thanks in advance

Translated with www.DeepL.com/Translator (free version)