Updated to fall back on file extension if the content-type header was not set.