Commit 4cdbf6f47a3a0d9e3f9e2acbdb0143662582a545

  • avatar
  • Petri Huttunen <petri.huttunen @j…u.fi> (Committer)
  • Thu Jul 14 12:24:38 EEST 2011
  • avatar
  • Petri Huttunen <petri.huttunen @j…u.fi> (Author)
  • Thu Jul 14 12:24:38 EEST 2011
File download fix.
app/controllers/datafiles_controller.rb
(1 / 1)
  
6868 return_value = %x[bin/mongofiles -db #{Mongoid.database.name} get #{attachment_path} -l #{temp_filename}]
6969
7070 if Rails.env.production?
71 response.headers["X-Sendfile"] = RAILS_ROOT + temp_filename
71 response.headers["X-Sendfile"] = RAILS_ROOT + "/" + temp_filename
7272 response.headers["Content-Type"] = attachment.file.content_type
7373 response.headers["Content-Disposition"] = "Content-Disposition: attachment; filename=\"#{url.split('/').last}\""
7474 head(:ok) and return