Created
May 2, 2021 11:59
-
-
Save isratmir/f49497a0e3769a9916c03181a0870ac2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Uppy</title> | |
<link href="https://releases.transloadit.com/uppy/v1.27.0/uppy.min.css" rel="stylesheet"> | |
</head> | |
<body> | |
<div id="drag-drop-area"></div> | |
<script src="https://releases.transloadit.com/uppy/v1.27.0/uppy.min.js"></script> | |
<script> | |
var uppy = Uppy.Core() | |
.use(Uppy.Dashboard, { | |
inline: true, | |
target: '#drag-drop-area' | |
}) | |
.use(Uppy.Tus, { | |
endpoint: 'https://api.cloudflare.com/client/v4/accounts/{accountID}/media', | |
headers: { | |
'Authorization': `Bearer {token}`, | |
}, | |
autoRetry: false, | |
chunkSize: 5242880 | |
}); | |
uppy.on('complete', (result) => { | |
console.log('Upload complete! We’ve uploaded these files:', result.successful) | |
}) | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment