i try upload a pdf to Google cloud Storage but i dont know why the file size is 0 bytes...
already i have try resolve this during 3 days but i not have response.. this is my code:
const cv = request.file('cv')
console.log(cv)
const gc = await new Storage({
projectId: GOOGLE_CLOUD_PROJECT_ID,
keyFilename: GOOGLE_CLOUD_KEYFILE,
})
const bucked = gc.bucket('rootbusco')
const file = bucked.file(cv.stream.filename)
const stream = await cv.stream.pipe(file.createWriteStream({
resumable: false,
gzip: true,
metadata: {
contentType: cv.stream.headers['content-type']
}
}))
stream.end(cv.stream.data);
thanks for the asks