fs.createReadStream(body).pipe(fs.createWriteStream('./public/image/doodle.png'));
我发现这样写入body需要时字符串的路径,我这里body是图片文件,我该怎么写入呢
这样的么
var http=require('http');
var fs=require('fs');
http.get('http://img30.360buyimg.com/shaidan/s128x96_jfs/t2326/17/1687232625/19293/4d621a93/56715d76N5eaaa8f1.jpg',function(response){
response.pipe(fs.createWriteStream('../../targetFiles/doodle.jpg'));
});