0

I'm confused on two things. I need to do these 2, but am not sure how:

  1. Get the buffer of a PRIVATE image in cloud firestore from node

  2. change the name of an imagefile thats in storage.(Either by setting the name as it is being uploaded, or changed afterward, both work).

Here is my current code that logs some giant thing that does indeed contain the file, but I can't find how to get the image data from it besides just the name of it/oth irrelivant stuff.

var theFile = bucket.file('Walks For Lives.png');
       console.log(theFile)

Ideally, to do both of these things, I seek some way to do this:

var theFile = bucket.file('Walks For Lives.png');
var the imageBuffer = theFile.buffer;

theFile.name.set("newName");
blueberrr
  • 63
  • 1
  • 7
  • Have you tried to check this [stackoverflow thread](https://stackoverflow.com/questions/36535153/uploading-a-buffer-to-google-cloud-storage#:~:text=We%20have%20an,end(fileContents)%3B) regarding the image file buffer? Also, check this documentation on how to [rename an object](https://cloud.google.com/storage/docs/copying-renaming-moving-objects#rename). – Sarah Remo Dec 11 '22 at 03:38

0 Answers0