I'm trying to upload file to amazon s3 and apparently I have to write to a temp file first then upload that file. But I cannot figure it out how to do that with Sinatra and heroku since it cannot find "#{RAILS_ROOT}" or #{Rail.root} how do I upload temp file to sinatra with heroku.
Thanks
I'm assuming you have read through Heroku's docs for Uploading to S3. The temp directory path on Heroku is ./tmp
. If you are running Sinatra, Heroku likely does not create the environment variables related to Rails (although it may, I'm not sure). Here is more info on Heroku's file system.
EDIT: In Sinatra, you can get the root directory via settings.root
, similar to RAILS_ROOT
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With