【发布时间】:2015-05-13 21:21:54
【问题描述】:
我在我的 Node.js 服务器上从 Dropbox 下载了一个缓冲区。我想将该缓冲区(或将其转换为文件并发送)发送到客户端,并让它立即开始在客户端下载。我在这里错过了什么?
var client = DBoxApp.client(req.session.dbox_access_token);
client.get(req.body.id, function(status, data, metadata) {
// WHAT DO I DO HERE?
})
这是我的角度(使用承诺)。当我 console.log(响应我得到一个包含缓冲区的对象)时。
function(id, cloud){
return $http.post('/download/'+cloud, {id: id}).then(function(response){
console.log(response)
}, function(response) {
return $q.reject(response.data);
})
}
【问题讨论】:
标签: node.js express dropbox-api