> For the complete documentation index, see [llms.txt](https://estare.gitbook.io/firebase-auth-firestore-and-storage-plugin/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://estare.gitbook.io/firebase-auth-firestore-and-storage-plugin/plugin-front-end-actions/firebase-storage/upload-file-base64.md).

# Upload file base64

This action allows you to upload a file encoded as base64 to Firebase Storage.

***

## <mark style="color:blue;">Inputs and Settings</mark>

<div align="left"><figure><img src="https://284736847-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FiWu3FezEjWxrPbkf8zIP%2Fuploads%2F4bMMVzufaSMHuUHMlB2R%2Fimage.png?alt=media&amp;token=fa182cff-4bbd-44fb-855b-11b7b0f55fdc" alt=""><figcaption></figcaption></figure></div>

### File Base64 string

The string of the file, in base64, that you want to upload to Firebase Storage.

### File Name (with extension)

The name you want the file to have on Storage, with it's extension,, since the process of infering which kind of file is being uploaded from a base64 is not always accurate.

### Filte String Type

Two options, base64 or data\_url:

<table><thead><tr><th width="142">Option</th><th>Description</th><th>Exemple</th></tr></thead><tbody><tr><td>base64</td><td>String of "pure content" in base64. That's the one Bubble provides on the backend, for instance.</td><td>VGhpcyBpcyBhIHRleHQgZW5jb2RlZCBpbiBiYXNlNjQ=</td></tr><tr><td>data_url</td><td>String of metadata + base64 content. If usually starts with "data:MIME-TYPE;base64," followed by the base64 string.</td><td>data:text/plain;base64,VGhpcyBpcyBhIHRleHQgZW5jb2RlZCBpbiBiYXNlNjQ</td></tr></tbody></table>

### Folder Path

<div align="left"><figure><img src="https://284736847-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FiWu3FezEjWxrPbkf8zIP%2Fuploads%2F8igQWBpHkm9YeLUstCR2%2Fimage.png?alt=media&amp;token=e1ac97b2-8d08-45a6-a8ef-a31d7c218a9d" alt=""><figcaption></figcaption></figure></div>

The path of the folder you want to store the file in. The path you specify will generate the folder on Firebase Storage, if it doesn't already exist.

### Trigger ID (optional)

This will link the action with a [Action Listener](/firebase-auth-firestore-and-storage-plugin/plugin-elements/firebase-action-listener.md) of the same ID.&#x20;

If left blank, all listeners on the page with blank ID's will be triggered at the same time, so we suggest to always define a Trigger ID.

When the function finishes running, it will trigger the [File Uploaded](https://estare.gitbook.io/firebase-auth-firestore-storage-plugin/plugin-elements/firebase-action-listener#file-uploaded) event, storing the Uploaded [Uploaded File URL](https://estare.gitbook.io/firebase-auth-firestore-storage-plugin/plugin-elements/firebase-action-listener#uploaded-file-url) on the listener element states.

***

## <mark style="color:blue;">Triggered events</mark>

Those events are triggered by an [Action Listener](/firebase-auth-firestore-and-storage-plugin/plugin-elements/firebase-action-listener.md) with the same ID as the [Trigger ID](#trigger-id-optional) provided on the action.

* File Uploaded (if the action was successful)
* Error in Action (if an error occurs)

***

## <mark style="color:blue;">Stored values on the listener</mark>

### Uploaded File URL

The URL of the file uploaded by the action.

### Error Message

If an error occurs, you can check its details on this state on the action listener.
