은승우

Update app.js

Showing 1 changed file with 11 additions and 2 deletions
......@@ -86,8 +86,17 @@ async function handleEvent(event) {
.then((stream) => {
stream.on('data', (chunk) => {
console.log(chunk);
var file=fs.createReadStream(chunk);
console.log(file);
fs.writeFileSync('./photo/image.png', chunk, function (err) {
if (err) {
console.log('에러발생');
console.dir(err);
return;
}
});
var file=fs.readFileSync('./photo/image.png','utf8',function (err, data) {
//파일 다 읽었을 대 호출 됨
});
console.log(file);
var cheerio = require('cheerio');
var uriBase = 'https://koreacentral.api.cognitive.microsoft.com/vision/v2.1/ocr';
......