Files upload HTML · JS
Upload files in your web browser.
Smash is a file upload API service, that provides the world best multiple files upload and transfer API solution without worrying about size limits.
Features
The files upload Node.js SDK helps you perform the following tasks:
Uploading
Add a file uploading capability to your website, app, Saas, etc.
Upload files of any type and up to 5 TB in size
Upload multiple files or folders in one go
Track upload jobs
Speed up the uploading with the acceleration network consisting of 300+ servers, powered by AWS in 9 regions around the world
Downloading
Download files from an URL
Show image, video and audio previews
Custom the download page with a logo and a background
Track downloads
Speed up the downloading with Cloudfront CDN
Storage
Files are stored from 1 to 30 days
Security
All uploads are signed
All uploaded files are scan by a malware protection service
All URLs are signed
Add a password protection on transfers
All your data are encrypted in-flight and at-rest (256-bit AES and SSL/TLS encryption)
Quick start
Once you have created your Smash Account for free and generated your first API Key, you can start to create your first transfer from the example code below:
Code example:
Replace "Put an API key here" with your own.
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="UTF-8" />
<script src="https://unpkg.com/@smash-sdk/uploader/dist/SmashUploader.browser.js"></script>
</head>
<body>
<form name="uploadForm">
<input id="uploadInput" type="file" multiple>
<input type="button" onclick="upload();" value="Send file(s)">
</form>
<script>
function upload() {
const fileInput = document.getElementById("uploadInput");
const su = new SmashUploader({ region: "eu-west-3", token: "Put your api key here" })
su.upload({ files: [...fileInput.files] })
.then(transfer => { console.log("Transfer", transfer); })
.catch(error => { console.log("Error", error); });
su.on('progress', (event) => { console.log(event.data.progress.percent); });
}
</script>
</body>
</html>
Docs / Integrations / HTML · JS
ON THIS PAGE
Intro
Features
Quick start
Advanced examples