MCPcopy Index your code
hub / github.com/appwrite/sdk-for-react-native / getFileViewURL

Method getFileViewURL

src/services/storage.ts:828–844  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

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};

Callers

nothing calls this directly

Calls 1

flattenMethod · 0.80

Tested by

no test coverage detected