I'm resizing a file with cloud functions and uploading the file to Firebase functions. I want to set the content-type
to. image/jpeg. I'm using google cloud storage to return a bucket..
const bucket = gcs.bucket(object.bucket)
;
and when I upload the file..
bucket.upload(imgPath, {
destination: join(bucketDir, newImgName),
metadata: {
metadata: {
contentType: 'image/jpeg',
firebaseStorageDownloadTokens: uuid
}
}
});
I able to access the file type of the image uploaded to Firebase Storage, which is application/octet-stream
, which triggers the operation. This is also the content-type of the resized file. How can I set the content-type to 'image/jpeg?