Data Types

Get Started

Upload simplifies file uploading & file processing for web apps. CDN & storage included.

Follow our documentation for a quick setup:

To install the Upload JavaScript SDK (to build your own file upload UI):

1<html>
2 <head>
3 <script src="https://js.upload.io/upload-js/v2"></script>
4 <script>
5 const upload = Upload({
6 apiKey: "free" // Replace "free" with your API key.
7 });
8
9 const onFileSelected = async (event) => {
10 try {
11 const { fileUrl } = await upload.uploadFile(
12 event.target.files[0],
13 { onProgress: ({ progress }) => console.log(`${progress}% complete`) }
14 );
15 alert(`File uploaded!\n${fileUrl}`);
16 } catch (e) {
17 alert(`Error!\n${e.message}`);
18 }
19 }
20 </script>
21 </head>
22 <body>
23 <input type="file" onchange="onFileSelected(event)" />
24 </body>
25</html>

Or with NPM:

npm install upload-js
import { Upload } from "upload-js";
const upload = Upload({ apiKey: "free" }); // Replace "free" with your API key.
const onFileSelected = async (event) => {
const [ file ] = event.target.files;
const { fileUrl } = await upload.uploadFile(file, { onProgress });
alert(`File uploaded: ${fileUrl}`);
}
const onProgress = ({ progress }) => {
console.log(`File uploading: ${progress}% complete.`)
}
//
// <input type="file" onchange="onFileSelected(event)" />
//

The Upload Widget (our ready-made UI component) supports these web frameworks:

The Upload JavaScript SDK (headless library) supports browsers & Node.js:

Was this section helpful? Yes No

You are using an outdated browser.

This website requires a modern web browser -- the latest versions of these browsers are supported: