# 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="/files/HOm8tEm3MvxH4MPCCQf7" 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="/files/RCz6JofMbO75sYsZTaoU" 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.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://estare.gitbook.io/firebase-auth-firestore-and-storage-plugin/plugin-front-end-actions/firebase-storage/upload-file-base64.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
