Created
March 23, 2016 06:41
-
-
Save duanckham/b2b6d2c8b33b5e144b65 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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