@img-proxy/easy-s3-plugin
v1.2.1
Published
Tiny JS plugin to upload files to img-proxy.com.
Downloads
6
Readme
Easy S3 for img-proxy.com
This tiny JS script allows uploading files to img-proxy.com more easily.
How to use
- Include the library in your HTML page:
<script type="text/javascript" src="https://unpkg.com/@img-proxy.com/easy-s3-plugin/dist/easy-s3.min.js"></script>
- Create an
<input type="file">
and specify an ID (as well as other options as permitted by the API).
<label for="easy_s3">File to upload:</label>
<input type="file" id="easy_s3" name="file" multiple>
- Then, in your
<script>
section, instantiate a new EasyS3 object:
const easyS3 = new EasyS3({
selector: "#easy_s3",
domain: 'https://yourdomain.img-pro.xyz',
apiKeySecret: 'YOUR_API_KEY_SECRET'
})
Finally, you can "listen" to uploaded files using:
document.addEventListener('easy_s3_upload_complete', function(event) {
console.log(event.detail);
})
(c) 2022 – img-proxy.com