Added file extensions and mime types to file saving