# S3 file uploader

## Overview

*Upload to S3* is a button to upload files to Amazon S3. The uploader allows you to set ACL and specify file type restrictions and MIME types.

<figure><img src="/files/9iXRYWG3hNz8a6HZ2RxB" alt=""><figcaption></figcaption></figure>

### Properties

<table><thead><tr><th width="196.74609375">Name</th><th width="96.07421875">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>name</code></td><td><code>string</code></td><td>Component name</td></tr><tr><td><code>lastUploadedFileUrl</code></td><td><code>string</code></td><td>S3 URL of the last uploaded file</td></tr><tr><td><code>lastUploadedFileName</code></td><td><code>string</code></td><td>Name of the last uploaded file</td></tr></tbody></table>

### Triggers

<table><thead><tr><th width="173.5625">Name</th><th>Description</th></tr></thead><tbody><tr><td><strong>On Upload Success</strong></td><td>Triggered when a file is successfully uploaded</td></tr></tbody></table>

## Working with the component

If you are planning to use the S3 file uploader in UI Bakery, you first need to [connect your Amazon S3 as a data source](/reference/data-sources/amazon-s3.md) and [set up **CORS policies**](/reference/data-sources/amazon-s3.md#allowing-cors-for-s3-file-upload) for your bucket.

### To upload files to S3:

1. Add the **S3 file uploader** component to the working area.
2. Select the necessary *S3 data source* from the dropdown, specify the bucket, and set up other required settings.

<figure><img src="/files/4tVmDEzEuGx0864AGxmN" alt=""><figcaption></figcaption></figure>

3. Next, click on the component and select the necessary file to upload it.

Once it's uploaded, you will notice that the `lastUploadedFileUrl` is an S3 URL, and you can refer to it with the `{{ui.s3FileUploader.lastUploadedFileUrl}}` variable.

Also, If you need to call any action upon the file upload, you can use the **On Upload Success** trigger of the component.


---

# 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://docs.uibakery.io/reference/working-with-components/aws-s3-uploader.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.
