Stay organized with collections
Save and categorize content based on your preferences.
Properties
fullPath
fullPath: string
Methods
putString
- putString
(
data
:
string
,
format
?
:
StringFormat
,
metadata
?
:
UploadMetadata
)
:
firebase.storage.UploadTask
-
Parameters
Returns firebase.storage.UploadTask
toString
- toString
(
)
:
string
-
Returns string
The gs:// URL.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2023-05-23 UTC.
[null,null,["Last updated 2023-05-23 UTC."],[],[],null,["- [firebase](/docs/reference/node/firebase).\n- [storage](/docs/reference/node/firebase.storage).\n- Reference \nRepresents a reference to a Google Cloud Storage object. Developers can\nupload, download, and delete objects, as well as get/set object metadata.\n\nIndex\n\nProperties\n\n- [bucket](/docs/reference/node/firebase.storage.Reference#bucket)\n- [fullPath](/docs/reference/node/firebase.storage.Reference#fullpath)\n- [name](/docs/reference/node/firebase.storage.Reference#name)\n- [parent](/docs/reference/node/firebase.storage.Reference#parent)\n- [root](/docs/reference/node/firebase.storage.Reference#root)\n- [storage](/docs/reference/node/firebase.storage.Reference#storage)\n\nMethods\n\n- [child](/docs/reference/node/firebase.storage.Reference#child)\n- [delete](/docs/reference/node/firebase.storage.Reference#delete)\n- [getDownloadURL](/docs/reference/node/firebase.storage.Reference#getdownloadurl)\n- [getMetadata](/docs/reference/node/firebase.storage.Reference#getmetadata)\n- [list](/docs/reference/node/firebase.storage.Reference#list)\n- [listAll](/docs/reference/node/firebase.storage.Reference#listall)\n- [put](/docs/reference/node/firebase.storage.Reference#put)\n- [putString](/docs/reference/node/firebase.storage.Reference#putstring)\n- [toString](/docs/reference/node/firebase.storage.Reference#tostring)\n- [updateMetadata](/docs/reference/node/firebase.storage.Reference#updatemetadata)\n\nProperties\n\nbucket \nbucket: string \nThe name of the bucket containing this reference's object.\n\nfullPath \nfullPath: string \nThe full path of this object.\n\nname \nname: string \nThe short name of this object, which is the last component of the full path.\nFor example, if fullPath is 'full/path/image.png', name is 'image.png'.\n\nparent \nparent: [Reference](/docs/reference/node/firebase.storage.Reference) \\| null \nA reference pointing to the parent location of this reference, or null if\nthis reference is the root.\n\nroot \nroot: [Reference](/docs/reference/node/firebase.storage.Reference) \nA reference to the root of this reference's bucket.\n\nstorage \nstorage: [Storage](/docs/reference/node/firebase.storage.Storage) \nThe storage service associated with this reference.\n\nMethods\n\nchild\n\n- child ( path : string ) : [Reference](/docs/reference/node/firebase.storage.Reference)\n- Returns a reference to a relative path from this reference.\n\n Parameters\n -\n\n path: string \n The relative path from this reference.\n Leading, trailing, and consecutive slashes are removed.\n\n Returns [Reference](/docs/reference/node/firebase.storage.Reference)\n\n The reference to the given path.\n\ndelete\n\n- delete ( ) : Promise \\\u003c void \\\u003e\n- Deletes the object at this reference's location.\n\n Returns Promise\\\u003cvoid\\\u003e\n\n A Promise that resolves if the deletion\n succeeded and rejects if it failed, including if the object didn't exist.\n\ngetDownloadURL\n\n- getDownloadURL ( ) : Promise \\\u003c string \\\u003e\n- Fetches a long lived download URL for this object.\n\n Returns Promise\\\u003cstring\\\u003e\n\n A Promise that resolves with the download\n URL or rejects if the fetch failed, including if the object did not\n exist.\n\ngetMetadata\n\n- getMetadata ( ) : Promise \\\u003c [FullMetadata](/docs/reference/node/firebase.storage.FullMetadata) \\\u003e\n- Fetches metadata for the object at this location, if one exists.\n\n Returns Promise\\\u003c[FullMetadata](/docs/reference/node/firebase.storage.FullMetadata)\\\u003e\n\n A Promise that\n resolves with the metadata, or rejects if the fetch failed, including if\n the object did not exist.\n\nlist\n\n- list ( options ? : [ListOptions](/docs/reference/node/firebase.storage.ListOptions) ) : Promise \\\u003c [ListResult](/docs/reference/node/firebase.storage.ListResult) \\\u003e\n- List items (files) and prefixes (folders) under this storage reference.\n\n List API is only available for Firebase Rules Version 2.\n\n GCS is a key-blob store. Firebase Storage imposes the semantic of '/'\n delimited folder structure.\n Refer to GCS's List API if you want to learn more.\n\n To adhere to Firebase Rules's Semantics, Firebase Storage does not\n support objects whose paths end with \"/\" or contain two consecutive\n \"/\"s. Firebase Storage List API will filter these unsupported objects.\n `list()` may fail if there are too many unsupported objects in the bucket.\n\n Parameters\n -\n\n Optional options: [ListOptions](/docs/reference/node/firebase.storage.ListOptions) \n See `ListOptions` for details.\n\n Returns Promise\\\u003c[ListResult](/docs/reference/node/firebase.storage.ListResult)\\\u003e\n\n A Promise that resolves with the items and prefixes.\n `prefixes` contains references to sub-folders and `items`\n contains references to objects in this folder. `nextPageToken`\n can be used to get the rest of the results.\n\nlistAll\n\n- listAll ( ) : Promise \\\u003c [ListResult](/docs/reference/node/firebase.storage.ListResult) \\\u003e\n- List all items (files) and prefixes (folders) under this storage reference.\n\n This is a helper method for calling `list()` repeatedly until there are\n no more results. The default pagination size is 1000.\n\n Note: The results may not be consistent if objects are changed while this\n operation is running.\n\n Warning: `listAll` may potentially consume too many resources if there are\n too many results.\n\n Returns Promise\\\u003c[ListResult](/docs/reference/node/firebase.storage.ListResult)\\\u003e\n\n A Promise that resolves with all the items and prefixes under\n the current storage reference. `prefixes` contains references to\n sub-directories and `items` contains references to objects in this\n folder. `nextPageToken` is never returned.\n\nput\n\n- put ( data : Blob \\| Uint8Array \\| ArrayBuffer , metadata ? : [UploadMetadata](/docs/reference/node/firebase.storage.UploadMetadata) ) : firebase.storage.UploadTask\n- Uploads data to this reference's location.\n\n Parameters\n -\n\n data: Blob \\| Uint8Array \\| ArrayBuffer \n The data to upload.\n -\n\n Optional metadata: [UploadMetadata](/docs/reference/node/firebase.storage.UploadMetadata) \n Metadata for the newly\n uploaded object.\n\n Returns firebase.storage.UploadTask\n\n An object that can be used to monitor\n and manage the upload.\n\nputString\n\n- putString ( data : string , format ? : [StringFormat](/docs/reference/node/firebase.storage#stringformat) , metadata ? : [UploadMetadata](/docs/reference/node/firebase.storage.UploadMetadata) ) : firebase.storage.UploadTask\n- Uploads string data to this reference's location.\n\n throws\n\n : If the format is not an allowed format, or if the given string\n doesn't conform to the specified format.\n\n Parameters\n -\n\n data: string \n The string to upload.\n -\n\n Optional format: [StringFormat](/docs/reference/node/firebase.storage#stringformat) \n The format of the string to\n upload.\n -\n\n Optional metadata: [UploadMetadata](/docs/reference/node/firebase.storage.UploadMetadata) \n Metadata for the newly\n uploaded object.\n\n Returns firebase.storage.UploadTask\n\ntoString\n\n- toString ( ) : string\n- Returns a gs:// URL for this object in the form\n `gs://\u003cbucket\u003e/\u003cpath\u003e/\u003cto\u003e/\u003cobject\u003e`\n\n Returns string\n\n The gs:// URL.\n\nupdateMetadata\n\n- updateMetadata ( metadata : [SettableMetadata](/docs/reference/node/firebase.storage.SettableMetadata) ) : Promise \\\u003c [FullMetadata](/docs/reference/node/firebase.storage.FullMetadata) \\\u003e\n- Updates the metadata for the object at this location, if one exists.\n\n Parameters\n -\n\n metadata: [SettableMetadata](/docs/reference/node/firebase.storage.SettableMetadata) \n The new metadata.\n Setting a property to 'null' removes it on the server, while leaving\n a property as 'undefined' has no effect.\n\n Returns Promise\\\u003c[FullMetadata](/docs/reference/node/firebase.storage.FullMetadata)\\\u003e\n\n A Promise that\n resolves with the full updated metadata or rejects if the updated failed,\nincluding if the object did not exist."]]
Represents a reference to a Google Cloud Storage object. Developers can upload, download, and delete objects, as well as get/set object metadata.