Search code examples
node.jsjsongoogle-app-enginegoogle-cloud-storage

How to download json file to cloud storage on app engine node.js standard environment


I have a web application on GAE node.js standard environment. The server receives a POST request containing json in its body (not ready json file). I want to write this json file to Cloud Storage. How to do this?


Solution

  • You need to write JSON file to /tmp directory using fs.createWriteStream and then write it to Storage using Storage API