AU
Size: a a a
AU
R
const file = await this.gotInsanse(photoUrl);Потом я проверяю контент тайп
const [mime, type] = file.headers['content-type'].split('/'); , и если это картинка мне надо её сохранить. как константу file превратить в readable Stream ?y
const stream = new Readable();и далее stream.pipe(...)
stream._read = () => {};
stream.push(file.body);
stream.push(null);
typeof file.bodyAU
AU
typeof file.bodybody: 'я┐╜PNG\r\n' +
'\u001a\n' +
'\u0000\u000
AU
W
y
body: 'я┐╜PNG\r\n' +
'\u001a\n' +
'\u0000\u000
const buffer = Buffer.from(file.body)
const stream = new Readable()
stream.push(buffer)
stream.push(null)
y
const buffer = Buffer.from(file.body)
const stream = new Readable()
stream.push(buffer)
stream.push(null)
AU
const buffer = Buffer.from(file.body)
const stream = new Readable()
stream.push(buffer)
stream.push(null)
AU
y
y
AU
AU
y
y
AU
PM
y