Closed gpmcadamold closed 8 years ago
I can't confirm, I haven't had a chance to look in to it, Guzzle 6 support was only added a week ago. If you can get away with using Guzzle 5 then do that. I'll have a look in to the issue further when I get a chance
It was quite an easy one to fix. Just run composer update robbiep/cloudconvert-laravel
Just in case anyone else runs in to the same problem here was my fix:
If you upload a file with Guzzle 6 you have to send via ['multipart' => $mutlipartArray]
$mutlipartArray
consists of an array of ['name' => 'fieldname', 'contents' => $contents]
where $contents
has to be one of: StreamInterface / resource / string
, unfortunately not an array.
I just flattened the array, so $contents
is always a string or a resource, so in my case the converteroptions
section of $mutlipartArray
now looks something like this ['name' => 'converteroptions[resize]', 'contents' => '4000']
See commit 0ae47d131962f33df73e6666f8c9745be64f7701
When passing converter options as an array in the following way, Guzzle throws an exception.
The exception is:
And it's occurring in
at GuzzleHttp\Psr7\stream_for(array('resize' => '4000')) in MultipartStream.php line 87
Could it be related to this? https://github.com/guzzle/guzzle/issues/1079
Can you confirm that passing options as an array is still supported?