-
-
Save toanalien/718b415ccc89f008d180 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 fs = require('fs'); | |
var request = require('request'); | |
var Box = require('./controllers/BoxControllers'); | |
var box = new Box({ | |
access_token: "duPlRu6eWRWJ42sIEb6Mlc2fUdjx4uRL", | |
refresh_token: "mPZjuJZxqitdfbSWO7TU2IgxmXuZvF4Ge0bB328jCnL3h3SvMQpmobKx93xajUEi" | |
}); | |
request.post('https://upload.box.com/api/2.0/files/content', { | |
headers: { | |
Authorization: "Bearer duPlRu6eWRWJ42sIEb6Mlc2fUdjx4uRL" | |
}, | |
formData: { | |
attributes: { | |
name: "app.js", | |
parent: { | |
id: 0 | |
} | |
}, | |
file: fs.createReadStream('abc.txt') | |
} | |
}, function(err, res, body) { | |
// | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment