Add file extension detection