Modified the way file input streams are handled so they can be properly closed.
Added content types, fixed an issue where raw bytes (such as gifs or jpgs) were not being returned in a format understood by the browser.