JavaScript File Uploader

Welcome to the Simple File Upload JavaScript Uploader documentation. This documentation provides guidance on how to add the Simple File Upload JavaScript Uploader to your projects. Let's get started! 

1. Add the JavaScript snippet

Add the following script tag to the `head` section of your application.

This replaces'YOUR_BUCKET_UUID' with your actual bucket UUID:

<script src="https://app.simplefileupload.com/buckets/YOUR_BUCKET_UUID.js"></script>

2. Add a hidden input field

Add a hidden input field into your HTML form where you want the file uploader to appear:

<input type="hidden" name="uploaded_file_url" class="simple-file-upload">

This field will handle file uploads, and its value will automatically be set to the uploaded file's URL.

3. Handle the uploaded file URL

Use JavaScript to listen for the `fileUploadSuccess` event and retrieve the uploaded file's URL:

document.getElementById('file_url').addEventListener('fileUploadSuccess', function() {
  console.log(this.value); // This is the URL of the uploaded file
});

4. Save the file URL

Once the upload is successful, you can send the URL to your server or handle it directly in your app as needed.

Get Started with Simple File Upload.

Easy Uploads. Effortless Integration.

Start Uploading for Free