SQLTerminal.app
now available

XPath.app
now available
Want fresh tech tips in your inbox?

Rails Send_File in Production Delivers an Empty File

       

If you're running Rails in production it will by default be configured to let apache or nginx send files for you. If you're handling file downloads yourself with send_file


send_file("path/to/file.txt")
you will notice that the downloaded files are empty. To get around this just comment out the following in your config/environments/production.rb file.

  # comment out for production because apache/nginx are not doing this for us
  #config.action_dispatch.x_sendfile_header = "X-Sendfile"

Tagged w/ #gotchas #mishaps #production #rails #send_fileruby on rails

Apps I've Built

XPath Expression Editor
Practice and improve your XPath skills with XPath Editor
Click to buy on the App Store
Photo Location Changer
Easily change the location on your photos and videos
Click here for more info about the app
Photo Date Changer
Easily change the dates and times on your photos and videos
Click here for more info about the app
VocabReminder
English dictionary with notifications so you won't forget what you're studying!
Click here for more info about the app
VocabQuiz
The app that quizzes and scores you on your vocabulary!
Click here for more info about the app