* Get a file content by its unique ID. This endpoint is similar to the * download method but returns with no 'Content-Disposition: attachment' * header. * * @param {string} bucketId * @param {string} fileId * @param {string} token * @throws {AppwriteException}
(bucketId: string, fileId: string, token?: string)
| 826 | * @returns {URL} |
| 827 | */ |
| 828 | getFileViewURL(bucketId: string, fileId: string, token?: string): URL { |
| 829 | const apiPath = '/storage/buckets/{bucketId}/files/{fileId}/view'.replace('{bucketId}', bucketId).replace('{fileId}', fileId); |
| 830 | const payload: Payload = {}; |
| 831 | |
| 832 | if (typeof token !== 'undefined') { |
| 833 | payload['token'] = token; |
| 834 | } |
| 835 | |
| 836 | const uri = new URL(this.client.config.endpoint + apiPath); |
| 837 | payload['project'] = this.client.config.project; |
| 838 | |
| 839 | for (const [key, value] of Object.entries(Service.flatten(payload))) { |
| 840 | uri.searchParams.append(key, value); |
| 841 | } |
| 842 | |
| 843 | return uri; |
| 844 | } |
| 845 | }; |