You have two options: a file store like S3 or a database.
Storing files on S3 is inexpensive and reliable. There's a built in protocol for passing URLs to the file between your front-end web processes and back-end workers. I strongly recommend this.
You can also store the file contents in a database like Postgres or Redis, which both your front-end web processes and back-end dynos have access to. Databases are generalized engines and usually more expensive places to store files. This will also work, but I don't recommend it.