Skip to content

Instantly share code, notes, and snippets.

@rexxars rexxars/gist:9111474
Last active Aug 29, 2015

Embed
What would you like to do?
Async.js + imboclient.js
var imbo = new Imbo.Client('host', 'pub', 'priv');
var fileInput = document.querySelector('input[type=file]');
fileInput.addEventListener('change', uploadFiles, false);
function uploadFiles() {
async.mapSeries(
fileInput.files,
imbo.addImage.bind(imbo),
onFilesUploaded
);
};
function onFilesUploaded(err, imageIdentifiers) {
if (err) {
return console.error('Failed to upload images!', err);
}
console.log(imageIdentifiers.map(imbo.getImageUrl.bind(imbo)));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.