Set mime based on name when passing a string to putObject

- New function _getMIMETypeByFilename with an extensive lookup of
extensions
- Call that function within _getMIMEType before using the fileinfo
extension
- I realize that this codebase may not be maintained any longer but I thought I would share my changes