Skip to content
Create a gist now

Instantly share code, notes, and snippets.

Embed URL


Subversion checkout URL

You can clone with
Download ZIP
var fs = require('fs');
var request = require('request');
var async = require('async');
var apiUrl = '';
var filenames = fs.readdirSync(path);
async.forEach(filenames, function(filename, callback) {
// open a file stream on the local image
var fileStream = fs.createReadStream(path + filename);
// read from the file and write to the HTTP request
fileStream.on('end', callback);
}, function(err) {
console.log(err ? err.message : 'Finished!');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.