은승우

Update app.js

Showing 1 changed file with 10 additions and 1 deletions
...@@ -86,7 +86,16 @@ async function handleEvent(event) { ...@@ -86,7 +86,16 @@ async function handleEvent(event) {
86 .then((stream) => { 86 .then((stream) => {
87 stream.on('data', (chunk) => { 87 stream.on('data', (chunk) => {
88 console.log(chunk); 88 console.log(chunk);
89 - var file=fs.createReadStream(chunk); 89 + fs.writeFileSync('./photo/image.png', chunk, function (err) {
90 + if (err) {
91 + console.log('에러발생');
92 + console.dir(err);
93 + return;
94 + }
95 + });
96 + var file=fs.readFileSync('./photo/image.png','utf8',function (err, data) {
97 + //파일 다 읽었을 대 호출 됨
98 + });
90 console.log(file); 99 console.log(file);
91 var cheerio = require('cheerio'); 100 var cheerio = require('cheerio');
92 101
......