You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
description: The Firebase Storage library provides access to the files in Cloud Storage through the Firebase SDK beyond what FlutterFlow's built-in support provides.
3
+
title: Firebase Storage Library
4
+
description: The Firebase Storage Library provides access to the files in Cloud Storage through the Firebase SDK beyond what FlutterFlow's built-in support provides.
The [Firebase Storage library][storage-library-item] provides access to the files in Cloud Storage through the Firebase SDK beyond what [FlutterFlow's built-in support](/concepts/file-handling) provides.
10
+
The [Firebase Storage Library][storage-library-item] provides access to the files in Cloud Storage through the Firebase SDK beyond what [FlutterFlow's built-in support](/concepts/file-handling) provides.
*`uploadFileToBucket`\- Upload a file to any path in any bucket that you have write access to.
30
-
* Parameters:
28
+
***Parameters:**
31
29
* The `bucketName` (`String?`) to upload the file to. If you leave this empty, it uses the default bucket of the associated Firebase project.
32
30
* The `fullPath` (`String?`) where the file will be written to inside the bucket. If this is specified, the `prefix` parameter is ignored.
33
31
* The `uploadedFile` (`FFUploadedFile`) that is to be uploaded to Cloud Storage. This is the action output of a previous `Store media for upload` action.
34
32
* The `prefix` (folder/directory) (`String?`) where the file will be uploaded to. If `fullPath` is not specified, the action uses this parameter and the `name` of the `uploadedFile` to determine the full path where it writes the file.
35
-
* Action result:
33
+
***Action result:**
36
34
* If successful, the action result is a `fileObject` containing the full path of the uploaded file.
35
+
37
36
*`listAllFilesInBucket`\- List all files in any bucket that you have read access to.
38
-
* Parameters:
37
+
***Parameters:**
39
38
* The `bucketName` (`String?`) to list the files from. If you leave this empty, it uses the default bucket of the associated Firebase project.
40
39
* The `listType` (`StorageListType?`) of the items to list (files, directories, both). If left empty, the action will list both files and prefixes (folders/directories).
41
40
* The `prefix` (`String?`) is the `/` separated path from which to list files. If left empty, the action will list the items in the root of the storage bucket.
42
-
* Action result:
43
-
* If successful, the action results in a `List` of `fileObject` elements.
41
+
***Action result:**
42
+
* If successful, the action results in a `List` of `fileObject` elements.
43
+
44
44
*`downloadFile`\- Download the data for a file that you have read access to. This downloads the actual data into your application code. If you instead want a public URL to the data, use `getDownloadUrl` instead.
45
-
* Parameters:
45
+
***Parameters:**
46
46
* The `bucketName` (`String?`) to download the file from. If you leave this empty, it uses the default bucket of the associated Firebase project.
47
47
* The `fullPath` (`String`) of the file whose data will be read from the bucket.
48
-
* Action result:
48
+
***Action result:**
49
49
* If successful, the action result is an `FFUploadedFile` with the data of the file that was read from the bucket.
50
+
50
51
*`getDownloadUrl`\- Get the download URL for a file in a bucket that you have read access to. This URL then provides public, read-only access to the file
51
-
* Parameters:
52
+
***Parameters:**
52
53
* The `bucketName` (`String?`) that contains the file. If you leave this empty, it uses the default bucket of the associated Firebase project.
53
54
* The `fullPath` (`String`) of the file for which to get the download URL.
54
-
* Action result:
55
+
***Action result:**
55
56
* If successful, the action result is a HTTP URL that allows public access to the file.
57
+
56
58
*`getMetadataForFile`\- Get the metadata for a file in any bucket that you have read access to
57
-
* Parameters:
59
+
***Parameters:**
58
60
* The `bucketName` (`String?`) that contains the file. If you leave this empty, it uses the default bucket of the associated Firebase project.
59
61
* The `fullPath` (`String`) of the file for which to get the download URL.
60
-
*Action result:
62
+
*A**ction result:**
61
63
* If successful, the action result is a `FullMetadata` with all the metadata and custom metadata of the file.
64
+
65
+
62
66
*`updateMetadataForFile`\- Update the metadata for a file in any bucket that you have write access to
63
-
* Parameters:
67
+
***Parameters:**
64
68
* The `bucketName` (`String?`) that contains the file. If you leave this empty, it uses the default bucket of the associated Firebase project.
65
69
* The `fullPath` (`String`) of the file for which to get the download URL.
66
70
* The `metadata` (`SettableMetadata`) to write to the Cloud Storage bucket for the file. If any value is left out or empty in the metadata, it is left unmodified in Cloud Storage.
67
-
* Action result:
71
+
***Action result:**
68
72
* If successful, the action result is a `FullMetadata` with all the metadata and custom metadata of the file after the update.
73
+
74
+
69
75
*`getPathFromUrl`\- Get the path for a file based on its (https:// or gs://) URL. This is a synchronous call, as it doesn't require any call to the server.
70
-
* Parameters
76
+
***Parameters**
71
77
* The `Url` to parse.
72
-
* Action result:
78
+
***Action result:**
73
79
* The action result is a `fileObject` derived from the URL.
80
+
74
81
*`deleteFileFromBucket`\- Deletes a file from any bucket you have write access to.
75
-
* Parameters:
82
+
***Parameters:**
76
83
* The `bucketName` (`String?`) that contains the file. If you leave this empty, it uses the default bucket of the associated Firebase project.
77
84
* The `fullPath` (`String`) of the file to delete from the bucket.
78
-
* Action result:
85
+
***Action result:**
79
86
* If the action succeeds the file has been deleted. There is no additional information.
80
87
81
88
### Enums
@@ -90,6 +97,8 @@ To start using this library:
90
97
*`fileObject`\- the metadata for a file or prefix (folder/directory) in Cloud Storage. It has the following fields:
91
98
*`fullPath` (`String`) \- The full path of the file/prefix inside the storage bucket. The value does not start with a leading `/`.
92
99
*`isPrefix` (`Boolean`) \- Indicates whether the object is a file (`false`) or prefix (folder/directory) (`true`).
100
+
101
+
93
102
*`FullMetadata`\- the full metadata of an item in a storage bucket as returned by `getMetadataForFile`, modelled after the [`FullMetadata` class in the Firebase SDK for Cloud Storage](https://pub.dev/documentation/firebase_storage/latest/firebase_storage/FullMetadata-class.html).
94
103
*`SettableMetadata`\- the settable metadata of an item in a storage bucket, as passed to a call to `updateMetadataForFile`, modelled after the [`SettableMetadata` class in the Firebase SDK for Cloud Storage](https://pub.dev/documentation/firebase_storage/latest/firebase_storage/SettableMetadata-class.html).
95
104
*`KeyValuePair`\- A `String`/`String` key/value pair as used for the `customMetadata` in the `FullMetadata` and `SettableMetadata` data types.
0 commit comments