Is it possible to host a blob using Guzzle? The only methods I could find were using @filename to upload a local file. The file is stored as a blob in the MySQL database, and I would like to upload it to the api as a message field without redundantly saving the blob to disk (and the rights / path issues that come with it), downloading @filename, and then disconnecting the file. Here is the code that I have that works for everything except blob. I need the 'file' field to save the data as a blob.
$data = array(
'first_name' => $fname,
'last_name' => $lname,
'email' => $email,
'partner_key' => 'qwerty',
'secret_key' => 'qwerty',
'file' => $fileblob
);
$curl = new \GuzzleHttp\Client();
return $curl->post('https://www.api.com',['verify'=>false,'body'=>$data])
The goal is to replace existing cURL code with Guzzle:
'file' => "@".$localfile.";type=".mime_content_type($localfile)
source
share