Skip to content

Instantly share code, notes, and snippets.

@duanckham
Created March 23, 2016 06:41
Show Gist options
  • Save duanckham/b2b6d2c8b33b5e144b65 to your computer and use it in GitHub Desktop.
Save duanckham/b2b6d2c8b33b5e144b65 to your computer and use it in GitHub Desktop.
var request = require('request');
var fs = require('fs');
var url = 'http://storage.yunpro.cn/upload';
var req = request.post(url, function(err, res, body) {
!err && console.log(body);
});
var form = req.form();
form.append('file', fs.createReadStream('/etc/hosts'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment