This doesn't answer the question but it might be useful as a workaround.
Every year or so think I have to do something like this, for example to import a CSV into an app on Heroku. Maybe it's secure data so I don't want to give it a public URL. I literally have to find this SO answer, and I jump through all the hoops to upload the file and connect to the particular dyno.
But then I realize (this has happened more than once!) that I can just export the Heroku environment variables into my shell and run my app locally in production mode — Rails at least will connect to the production Heroku database with the DATABASE_URL parameter in the ENV. So instead of trying to move the file to Heroku, I keep it locally, run the app locally, but connect to the production database. I run the import task and the data goes into the production database. Magic.