When a Pokémon with Download enters battle, or when a Pokémon gains Download, Download raises either the Attack stat or Special Attack stat by one stage depending on the foe's currently lowest defensive stat. It raises Attack if the foe's current Defense is lower than its current Special Defense stat; otherwise, it raises Special Attack. In case of a tie between Defense and Special Defense, Download increases 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.
During a battle with multiple opponents, Download calculates the average Defense and Special Defense by adding the stats of all opposing Pokémon, and determines 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.
The Pokémon's Attack or Sp. Atk sometimes goes up when the Pokémon uses a move on an enemy. If the enemy's Defense is higher than its Sp. Def, Sp. Atk goes up, and if its Sp. Def is higher, Attack goes up!