Skip to content

Commit 8ab74b3

Browse files
committed
Fixed file param bug
1 parent 36a6b4c commit 8ab74b3

File tree

6 files changed

+8
-8
lines changed

6 files changed

+8
-8
lines changed

docs/examples/functions/create-tag.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ $client
1313

1414
$functions = new Functions($client);
1515

16-
$result = $functions->createTag('[FUNCTION_ID]', '[COMMAND]', '');
16+
$result = $functions->createTag('[FUNCTION_ID]', '[COMMAND]', new \CURLFile('/path/to/file.png', 'image/png', 'file.png'));

docs/examples/storage/create-file.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ $client
1313

1414
$storage = new Storage($client);
1515

16-
$result = $storage->createFile('');
16+
$result = $storage->createFile(new \CURLFile('/path/to/file.png', 'image/png', 'file.png'));

docs/functions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ Use the "command" param to set the entry point used to execute your co
184184
| --- | --- | --- | --- |
185185
| functionId | string | **Required** Function unique ID. | |
186186
| command | string | Code execution command. | |
187-
| code | string | Gzip file with your code package. When used with the Appwrite CLI, pass the path to your code directory, and the CLI will automatically package your code. Use a path that is within the current directory. | |
187+
| code | file | Gzip file with your code package. When used with the Appwrite CLI, pass the path to your code directory, and the CLI will automatically package your code. Use a path that is within the current directory. | |
188188

189189
## Get Tag
190190

docs/storage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ POST https://appwrite.io/v1/storage/files
2929

3030
| Field Name | Type | Description | Default |
3131
| --- | --- | --- | --- |
32-
| file | string | Binary file. | |
32+
| file | file | Binary file. | |
3333
| read | array | An array of strings with read permissions. By default only the current user is granted with read permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions. | |
3434
| write | array | An array of strings with write permissions. By default only the current user is granted with write permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions. | |
3535

src/Appwrite/Services/Functions.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,11 +289,11 @@ public function listTags(string $functionId, string $search = '', int $limit = 2
289289
*
290290
* @param string $functionId
291291
* @param string $command
292-
* @param string $code
292+
* @param \CurlFile $code
293293
* @throws Exception
294294
* @return array
295295
*/
296-
public function createTag(string $functionId, string $command, string $code):array
296+
public function createTag(string $functionId, string $command, \CurlFile $code):array
297297
{
298298
$path = str_replace(['{functionId}'], [$functionId], '/functions/{functionId}/tags');
299299
$params = [];

src/Appwrite/Services/Storage.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,13 @@ public function listFiles(string $search = '', int $limit = 25, int $offset = 0,
4444
* assigned to read and write access unless he has passed custom values for
4545
* read and write arguments.
4646
*
47-
* @param string $file
47+
* @param \CurlFile $file
4848
* @param array $read
4949
* @param array $write
5050
* @throws Exception
5151
* @return array
5252
*/
53-
public function createFile(string $file, array $read = [], array $write = []):array
53+
public function createFile(\CurlFile $file, array $read = [], array $write = []):array
5454
{
5555
$path = str_replace([], [], '/storage/files');
5656
$params = [];

0 commit comments

Comments
 (0)