Fixed bug where mimetype was always application/octet-stream
This broke downloads of text files and everything else too.