src/OfficialAccount/Material/Client.php 1 location
|
@@ 238-240 (lines=3) @@
|
235 |
|
*/ |
236 |
|
public function upload(string $type, string $path, array $form = []) |
237 |
|
{ |
238 |
|
if (!file_exists($path) || !is_readable($path)) { |
239 |
|
throw new InvalidArgumentException(sprintf('File does not exist, or the file is unreadable: "%s"', $path)); |
240 |
|
} |
241 |
|
|
242 |
|
$form['type'] = $type; |
243 |
|
|
src/OfficialAccount/ShakeAround/MaterialClient.php 1 location
|
@@ 36-38 (lines=3) @@
|
33 |
|
*/ |
34 |
|
public function uploadImage(string $path, string $type = 'icon') |
35 |
|
{ |
36 |
|
if (!file_exists($path) || !is_readable($path)) { |
37 |
|
throw new InvalidArgumentException(sprintf('File does not exist, or the file is unreadable: "%s"', $path)); |
38 |
|
} |
39 |
|
|
40 |
|
return $this->httpUpload('shakearound/material/add', ['media' => $path], [], ['type' => strtolower($type)]); |
41 |
|
} |