Download support vs. master commit around 2013-07

This PR includes @Vitallium's original changes for #10052 rebased on a master commit from 2013-07.