Guest User

Untitled

a guest
Feb 20th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. def nginx_send_file(path)
  2. # Let Nginx detect content type unless it is explicitly set
  3. headers['Content-Type'] ||= ""
  4. headers["Content-Disposition"] ||= "attachment; filename=#{file.split('/').last}"
  5.  
  6. headers['X-Accel-Redirect'] = file
  7.  
  8. return ' '
  9. end
Add Comment
Please, Sign In to add comment