mirror of
https://github.com/transloadit/uppy.git
synced 2026-07-17 16:50:22 +00:00
- This PR upgrades `biome` from `2.0.5` -> `2.1.2` and adds two new rules - [noUnusedImports](https://biomejs.dev/linter/rules/no-unused-private-class-members) ( we already had suppressions for this rule in code, but the rule itself was never enabled in the config ) - [noUnusedPrivateClassMembers](https://biomejs.dev/linter/rules/no-unused-private-class-members/) - remove stale suppressions. - remove stale code. --------- Co-authored-by: Mikael Finstad <finstaden@gmail.com>
72 lines
2.1 KiB
HTML
72 lines
2.1 KiB
HTML
<!doctype html>
|
||
<html lang="en">
|
||
<head>
|
||
<meta charset="utf-8" />
|
||
<title>Uppy – AWS upload example</title>
|
||
<link href="./uppy.min.css" rel="stylesheet" />
|
||
</head>
|
||
<body>
|
||
<h1>AWS upload example</h1>
|
||
<details open name="uppy">
|
||
<summary>Sign on the server</summary>
|
||
<div id="uppy-sign-on-server"></div>
|
||
</details>
|
||
<details name="uppy">
|
||
<summary>Sign on the client (if WebCrypto is available)</summary>
|
||
<div id="uppy-sign-on-client"></div>
|
||
</details>
|
||
<footer>
|
||
You seeing the simplified example, with a backend that mimicks a
|
||
Companion-like instance. See
|
||
<a href="./withCustomEndpoints.html">the custom endpoint example</a> if
|
||
you need to see how to use one or more custom function for handling
|
||
communication with the backend.
|
||
</footer>
|
||
<noscript>You need JavaScript to run this example.</noscript>
|
||
<script type="module">
|
||
import { AwsS3, Dashboard, Uppy } from './uppy.min.mjs'
|
||
|
||
function onUploadComplete(result) {
|
||
console.log(
|
||
'Upload complete! We’ve uploaded these files:',
|
||
result.successful,
|
||
)
|
||
}
|
||
function onUploadSuccess(file, data) {
|
||
console.log(
|
||
'Upload success! We’ve uploaded this file:',
|
||
file.meta.name,
|
||
)
|
||
}
|
||
{
|
||
const uppy = new Uppy()
|
||
.use(Dashboard, {
|
||
inline: true,
|
||
target: '#uppy-sign-on-server',
|
||
})
|
||
.use(AwsS3, {
|
||
id: 'myAWSPlugin',
|
||
endpoint: '/',
|
||
})
|
||
|
||
uppy.on('complete', onUploadComplete)
|
||
uppy.on('upload-success', onUploadSuccess)
|
||
}
|
||
{
|
||
const uppy = new Uppy()
|
||
.use(Dashboard, {
|
||
inline: true,
|
||
target: '#uppy-sign-on-client',
|
||
})
|
||
.use(AwsS3, {
|
||
id: 'myAWSPlugin',
|
||
endpoint: '/',
|
||
getTemporarySecurityCredentials: typeof crypto?.subtle === 'object',
|
||
})
|
||
|
||
uppy.on('complete', onUploadComplete)
|
||
uppy.on('upload-success', onUploadSuccess)
|
||
}
|
||
</script>
|
||
</body>
|
||
</html>
|