In battle
Download raises either the Attack stat or Special Attack stat by one stage depending on the foe's currently lowest defensive stat: it will raise Attack if the foe's current Defense is lower than its current Special Defense stat; otherwise, it will raise Special Attack.
For determining which of the foe's defensive stats is lower, Download takes into account stat stages and the effect of Power Trick; however, it does not consider the effects of held items, Abilities such as Marvel Scale, or Wonder Room. In case of a tie between the foe's Defense and Special Defense, Download increases Special Attack.
During a Double Battle, Triple Battle, or Battle Royal, Download will calculate the average Defense and Special Defense by adding the stats of all opposing Pokémon, and determine the lowest stat between both averages.
Generation IV
Download does not take into account the defensive stats of opponents behind a Substitute. If all opponents are behind a substitute, Download will not activate.
Generation V onward
Download now takes into account the defensive stats of opponents behind a Substitute.
Outside of battle
Download has no effect outside of battle.