fixed downloading behavior to go by file extension instead of content type