Write content-type using file extension