Showing
1 changed file
with
2 additions
and
6 deletions
... | @@ -87,12 +87,8 @@ async function handleEvent(event) { | ... | @@ -87,12 +87,8 @@ async function handleEvent(event) { |
87 | .then((stream) => { | 87 | .then((stream) => { |
88 | stream.on('data', (chunk) => { | 88 | stream.on('data', (chunk) => { |
89 | const fs = require('fs'); | 89 | const fs = require('fs'); |
90 | - const file = fs.createWriteStream('./photo/image.jpeg'); | 90 | + const file = fs.writeFileSync('./photo/image.jpeg',chunk); |
91 | - for(let i=0; i<= 1e6; i++) { | 91 | + |
92 | - file.write(chunk); | ||
93 | - } | ||
94 | - file.end(); | ||
95 | - }); | ||
96 | }); | 92 | }); |
97 | var cheerio = require('cheerio'); | 93 | var cheerio = require('cheerio'); |
98 | 94 | ... | ... |
-
Please register or login to post a comment