Documentation
Introduction
Upload is a turn-key solution for adding file hosting functionality to your website or software. Follow these guides to get set up quickly:
Quick guide
At its core, Upload is a Software as a Service (SaaS) that provides easy file storage, file hosting and file processing functionality.
Upload also supports a "reverse proxy" mode, allowing developers to use Upload as a CDN to process & optimize images hosted on external servers.
Uploading
To begin uploading files, simply include Upload.js in your webpage:
Add the initialization code:
new Upload({ apiKey: "free" }).createFileInputHandler({
onUploaded: ({ fileUrl, fileId }) => {
// -----------------------------------------
// File successfully uploaded to upload.io!
// -----------------------------------------
// Send the file ID to your API, for example,
// to set it as the profile picture for a user.
// -----------------------------------------
console.log(`File uploaded to: ${fileUrl}`);
}
}); </script> ...</head>
And finally, add the upload button:
Storing
All files are permanently stored on Upload after being uploaded, until you delete them. To use the file in your web app, simply save its fileId to your database. You can use this ID to construct a URL to the file whenever you require it:
Downloading
To download your file, simply put the file ID after the Upload CDN base URL:
Files are publicly accessible by default. To access-protect your files, such that your API authorizes each individual access attempt to your files, see access-protected files.
Transforming
To transform a file, append the desired transformation's "slug" to the file URL:
To find the "slug" for the transformation you want to use, go to the Upload Dashboard and browse the available transformations, then take note of the desired transformation's "slug".
The response from the URL will be the transformed file.
For example, if the file ID AYU81093TgPQauaR points to a JPEG image, and you've created a transformation with the slug 300x200 in the Upload Dashboard that resizes images to 300x200, you would access the resized version of your JPEG using the following URL:
Of course, the original file will continue to be accessible via: