我已转换上传并将其存储为缓冲区。当我写这个缓冲区时,我得到一个路径错误。
TypeError:路径必须是字符串或缓冲区
const adapter = require('skipper-better-s3')(options);
var receiver = adapter.receive({dirname: "/original"});
var upstream = req.file('file');
upstream.upload(receiver, function(err, filesUploaded){
adapter.read(filesUploaded[0].extra.fd, (err, image) => {
Jimp.read(image,function(err,image){
image.resize(600, Jimp.AUTO).quality(60).getBuffer(image.getMIME(),function(err,buffer){
const stream = fs.createReadStream(buffer);
receiver = adapter.receive({dirname: "/thumbs"});
receiver.write(file, () => {
console.log(file.extra)
});
});
});
});
});