I'm using Parse Server on Heroku and I'm wondering if I'm able to save files to heroku via cloud code.
Something like this:
Cloud code (main.js):
Parse.Cloud.define("saveFile", function(request, response) {
fs.writeFile("test", "helloworld", function(err) {
if(err) {
return console.log(err);
}
console.log("The file was saved!");
});
}
then call this function via curl call in terminal:
curl -X POST -H "X-Parse-Application-Id: yourappid" -H “Content-Type: application/json" https://your-parse-server.herokuapp.com/parse/functions/saveFile
in heroku logs, I am able to see the console which prints "The file was saved", however, when I looked into the heroku /app directory (via heroku CLI: heroku run ls) the file "test" was not listed.
My questions:
- Am I not able to create any file and save it to Heroku filesystem?
- Is the file saved, but the directory of the file is hidden from me?
- Is there any way to verify that the file is saved?
- Is there any way to access the created file (if it is saved)?
Thanks in advance!