1
0
Fork 0
mirror of synced 2024-09-10 14:46:56 +12:00
appwrite/app/sdks/php/docs/storage.md

130 lines
3.8 KiB
Markdown
Raw Normal View History

2019-05-09 18:54:39 +12:00
# Storage Service
## List Files
```http request
2019-10-09 17:16:38 +13:00
GET https://appwrite.io/v1/storage/files
2019-05-09 18:54:39 +12:00
```
2019-10-09 17:16:38 +13:00
** /docs/references/storage/list-files.md **
2019-05-09 18:54:39 +12:00
### Parameters
| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| search | string | Search term to filter your list results. | |
| limit | integer | Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request. | 25 |
| offset | integer | Results offset. The default value is 0. Use this param to manage pagination. | 0 |
| orderType | string | Order result by ASC or DESC order. | ASC |
## Create File
```http request
2019-10-09 17:16:38 +13:00
POST https://appwrite.io/v1/storage/files
2019-05-09 18:54:39 +12:00
```
2019-10-09 17:16:38 +13:00
** /docs/references/storage/create-file.md **
2019-05-09 18:54:39 +12:00
### Parameters
| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| files | file | Binary Files. | |
2019-10-02 07:10:33 +13:00
| read | array | An array of strings with read permissions. [Learn more about permissions and roles](/docs/permissions). | [] |
| write | array | An array of strings with write permissions. [Learn more about permissions and roles](/docs/permissions). | [] |
2019-05-09 18:54:39 +12:00
| folderId | string | Folder to associate files with. | |
## Get File
```http request
2019-10-09 17:16:38 +13:00
GET https://appwrite.io/v1/storage/files/{fileId}
2019-05-09 18:54:39 +12:00
```
2019-10-09 17:16:38 +13:00
** /docs/references/storage/get-file.md **
2019-05-09 18:54:39 +12:00
### Parameters
| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| fileId | string | **Required** File unique ID. | |
2019-08-29 00:37:13 +12:00
## Update File
```http request
2019-10-09 17:16:38 +13:00
PUT https://appwrite.io/v1/storage/files/{fileId}
2019-08-29 00:37:13 +12:00
```
2019-10-09 17:16:38 +13:00
** /docs/references/storage/update-file.md **
2019-08-29 00:37:13 +12:00
### Parameters
| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| fileId | string | **Required** File unique ID. | |
2019-10-02 07:10:33 +13:00
| read | array | An array of strings with read permissions. [Learn more about permissions and roles](/docs/permissions). | [] |
| write | array | An array of strings with write permissions. [Learn more about permissions and roles](/docs/permissions). | [] |
2019-08-29 00:37:13 +12:00
| folderId | string | Folder to associate files with. | |
2019-05-09 18:54:39 +12:00
## Delete File
```http request
2019-10-09 17:16:38 +13:00
DELETE https://appwrite.io/v1/storage/files/{fileId}
2019-05-09 18:54:39 +12:00
```
2019-10-09 17:16:38 +13:00
** /docs/references/storage/delete-file.md **
2019-05-09 18:54:39 +12:00
### Parameters
| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| fileId | string | **Required** File unique ID. | |
2019-08-27 21:12:40 +12:00
## Get File for Download
2019-05-09 18:54:39 +12:00
```http request
2019-10-09 17:16:38 +13:00
GET https://appwrite.io/v1/storage/files/{fileId}/download
2019-05-09 18:54:39 +12:00
```
2019-10-09 17:16:38 +13:00
** /docs/references/storage/get-file-download.md **
2019-05-09 18:54:39 +12:00
### Parameters
| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| fileId | string | **Required** File unique ID. | |
2019-08-27 21:12:40 +12:00
## Get File Preview
2019-05-09 18:54:39 +12:00
```http request
2019-10-09 17:16:38 +13:00
GET https://appwrite.io/v1/storage/files/{fileId}/preview
2019-05-09 18:54:39 +12:00
```
2019-10-09 17:16:38 +13:00
** /docs/references/storage/get-file-preview.md **
2019-05-09 18:54:39 +12:00
### Parameters
| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| fileId | string | **Required** File unique ID | |
| width | integer | Resize preview image width, Pass an integer between 0 to 4000 | 0 |
| height | integer | Resize preview image height, Pass an integer between 0 to 4000 | 0 |
| quality | integer | Preview image quality. Pass an integer between 0 to 100. Defaults to 100 | 100 |
| background | string | Preview image background color. Only works with transparent images (png). Use a valid HEX color, no # is needed for prefix. | |
| output | string | Output format type (jpeg, jpg, png, gif and webp) | |
2019-08-27 21:12:40 +12:00
## Get File for View
2019-05-09 18:54:39 +12:00
```http request
2019-10-09 17:16:38 +13:00
GET https://appwrite.io/v1/storage/files/{fileId}/view
2019-05-09 18:54:39 +12:00
```
2019-10-09 17:16:38 +13:00
** /docs/references/storage/get-file-view.md **
2019-05-09 18:54:39 +12:00
### Parameters
| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| fileId | string | **Required** File unique ID. | |
| as | string | Choose a file format to convert your file to. Currently you can only convert word and pdf files to pdf or txt. This option is currently experimental only, use at your own risk. | |