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