var path = '{\"path\": \"' + jsonData.folder + '/' + jsonData.file + '.' + _file_Extension + '\",\"mode\": \"add\",\"autorename\": true,\"mute\": false}';
_getFileMetadata(_file_id, req.body.Trigger, (function (filepath) {
var buf = fs.createReadStream(filepath);
var options = {
method: 'POST',
url: url,
headers: {
'Authorization': 'Bearer ' + req.body.auth.access_token,
'Content-Type': 'application/octet-stream',
'Dropbox-API-Arg': path
},
body: buf
};
request(options, function (err, response) {
if (err) {
res.send('error');
} else {
res.send({resultdata: response.body});
}
});
}));
代码对于图像工作正常,但是如果PDf给出空的PDF页面没有文本