JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://api.filepicker.io/v1/filepicker.js"></script>
<input type="filepicker-dragdrop" id="drop"/>
<img id="thumb" alt="Thumbnail goes here"/>
JavaScript
filepicker.setKey('l5uQ3k7FQ5GoYCHyTdZV');
$("#drop").change(function(e) {
//get the file
var file = e.originalEvent.fpfile;
console.log("Storing ", file.filename);
//store the file
filepicker.store(file, {
location: "S3"
}, function(fpfile) {
//convert the file
filepicker.convert(fpfile, {
width: 200
}, function(resized_fpfile) {
//done
$("#thumb").attr("src", resized_fpfile.url);
})
});
});