0

I want to create sketch-files dynamically and make them downloadable. I want to use sketch-constructor (here is an example that is working on my computer).

The code runs on heroku and the is even the console.log() of the fulfilled promise but i can't see neither the directory nor the sketchfile itself.

Thanks for your help!

Chrissy
  • 19
  • 1
  • 4

1 Answers1

1

The Heroku filesystem is ephemeral - that means that any changes to the filesystem whilst the dyno is running only last until that dyno is shut down or restarted. Each dyno boots with a clean copy of the filesystem from the most recent deploy.

In addition, under normal operations dynos will restart every day in a process known as "Cycling".

These two facts mean that the filesystem on Heroku is not suitable for persistent storage of data. In cases where you need to store file, you can use a dedicated file storage service such as AWS S3

However, the file will be created before it would be deleted, to confirm /check if the file on the file system, run the command .

heroku login
heroku run bash -a APPNAME
$ cd app

You can navigate the folder structure of the app

Ibukun Muyide
  • 1,294
  • 1
  • 15
  • 23
  • thanks for your answer, but i have another question: I don´t need persistent storage, i as soon as the file is downloaded it can be removed from the storage. – Chrissy Jul 23 '20 at 16:12
  • The file should be created immediately but would be deleted later, I have updated my answer, use the code to check if the file structure after creation – Ibukun Muyide Jul 23 '20 at 16:19
  • 1
    Thanks for your help, but i am already navigating trying to find the file, but still not possible. I will make some research on the ephemeral system though, maybe this can help me – Chrissy Jul 23 '20 at 16:30