Revert "Removed rails streaming due to bugs with threads. Added mime-type detection."

This reverts commit 536ce79e2e37ee134b38c77fce47dc41f1ea39e7.
mime type lockup based on file extension