to better support the two types of downloading: http and local