Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
var fs = require('fs');
var request = require('request');
var apiUrl = '';
var filenames = fs.readdirSync(path);
filenames.forEach(function(filename) {
// 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', function() {
console.log('Sent file ' + filename);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment