sharey
v1.1.2
Published
Sharey, a small but powerful addon designed to help you upload files to third parties with ease.
Downloads
14
Maintainers
Readme
Sharey.js
Sharey is a powerful addon with a size of less than 2 KB that is designed to help you upload files to third parties with ease.
Key Features
- handle file uploads
- generate unique IDs for each upload
- get the upload date for each upload
Setup w/ CDN
<script src="https://cdn.jsdelivr.net/npm/[email protected]"></script>
Local Setup
<script src="path/to/sharey.min.js"></script>
Usage
// get value of file input
const file = document.querySelector('.fileInput').files[0]
// upload file to azury
sharey.azury(file, (res) => { // replace 'azury' with your desired service
console.log(res)
})
Please refer to this for a full example.
Sample Response
{
name: "file.png",
readableSize: "346.71 KB",
size: 346711,
token: "DfBQ1FytcPZMz06c4mvgRE25Lg_wtsCD",
type: "image/png",
uploadedAt: 1623503959635,
url: "https://azury.gg/a/654743ef4111e60a0c8667f5"
}