Closed 2366621450 closed 7 months ago
If you are looking into parallel uploads, you can use GuzzleHttp\Promise (which since 2.1.0 this library depends on).
Example:
$promises = []; foreach ($files_to_upload as $local_path => $remote_path) { $promise = new \GuzzleHttp\Promise\Promise( function () use (&$promise, $storage, $local_path, $remote_path) { /** @var \GuzzleHttp\Promise\Promise $promise */ $promise->resolve($storage->upload($local_path, $remote_path)); } ); $promises[$remote_path] = $promise; unset($promise); } \GuzzleHttp\Promise\Utils::unwrap($promises);
If you are looking into passing a directory/array of files to the upload() method, that unfortunately isn't possible at the moment.
upload()
If you are looking into parallel uploads, you can use GuzzleHttp\Promise (which since 2.1.0 this library depends on).
Example:
If you are looking into passing a directory/array of files to the
upload()
method, that unfortunately isn't possible at the moment.