Choosing mime-type based on file extension for file download.