0

Is it possible to use the Google Cloud Function to retrieve the contents of a file placed in Google Cloud Storage? Also, I would like to know how to do this.

I tried this,

 file = bucket.file(path)
 file.download.read

but I didn't read response

\xA3\xB4\x97..
kokeshi
  • 11
  • 3

1 Answers1

1
file = bucket.file(path)
downloaded_file = file.download
File.read(downloaded_file, encoding: 'ENCODE') # utf8 etc.

Also read this answer.

GL.

togi
  • 814
  • 5
  • 13