I'm trying to send a zip file using guzzle but all the tuts I found have failed.
Things I have tried :
$body = fopen('compress.zlib://http://www.example.com/myarchive.gz', 'rb');
$client->request('POST', 'upload-endpoint', ['body' => $body]);
Also using multipart :
$res = $client->request('POST', $this->base_api . $endpoint, [
'auth' => [ env('API_USERNAME'), env('API_PASSWORD') ],
'multipart' => [
[
'name' => 'FileContents',
'contents' => file_get_contents($path . $name),
'filename' => $name
],
[
'name' => 'FileInfo',
'contents' => json_encode($fileinfo)
]
],
]);
But I get data in $_POST like FileInfo and nothing in $_FILES. I don't know if this is even possible to do using guzzle if no is there a way I can do this using Curl ?
Edit: I tried doing it like in this question but this is for normal files not ZIP. That is causing me problems , because all i get is Resource id #some-number.