Accurate short-range shooting is where bows excel. The chance of hitting is much greater, it's possible to aim at gaps in armour (like the face, where open-faced helmets are worn), and the arrow has greater energy and is more likely to penetrate armour. Archers might well start shooting as soon as the enemy moves into effective range, but they can continue shooting, often with more effect, once the enemy is closer. Notably, against armoured enemy soldiers, archery often fails to stop them from getting close. The usual late Medieval English tactic was to protect the archers with armoured infantry and/or field fortifications. Under these circumstances, the enemy is likely to get close, and be halted there. The archers can usefully contribute by shooting at close range (and can be quite motivated to do so, by the thought of what will happen if the enemy defeats their protecting infantry screen).
Artwork often shows archers shooting at close range:
https://commons.wikimedia.org/wiki/File:Battle-poitiers(1356).jpg
https://commons.wikimedia.org/wiki/File:Battle_of_Auray_2.jpg
https://i.pinimg.com/564x/11/13/c4/1113c4bfa4fc507c1bd5c97f1effed8b.jpg
https://commons.wikimedia.org/wiki/File:MongolCavalrymen.jpg
In some cases, the archers are intermingled with other infantry, and are very close to the fighting. Archers are shown shooting at a horizontal angle, rather than at an elevated angle as used for long-range shooting. Of course, some caution is needed when using artwork like this as evidence, since it is possible that the artist has spatially compressed the battle to show more action in the space available.
Text sources also show that shooting was often at close range. From Japan, Miyamoto Musashi wrote in his Book of Five Rings:
The bow is tactically strong at the commencement of battle, especially battles on a moor, as it is possible to shoot quickly from among the spearmen. However, it is unsatisfactory in sieges, or when the enemy is more than forty yards away.
Thus, he considered the maximum useful range of archers to be 40 yards. This is supported by other writers:
For shooting an enemy on the battlefield, one needs, moreover, to practice shooting at a distance of seven or eight ken [fathoms] to be able to penetrate his armor.
by a 17th century writer complaining about the sportification of archery (quoted in Hurst (1998)).
From China, we have a first-hand battle account by a Manchu soldier, describing his use of close-range shooting (Dzengseo, 2006):
Looking behind me, I saw that armored soldier Dengse could not climb onto the bank. One rebel caught up with him and hacked at him. Because Dengse was scared, he ducked, turning his body on one side, so the rebel hit the quiver and the horse's croup. As Dengse fell off the horse, I shot the rebel, and made him fall down.
Thus, from the basic logic of battle, artwork, and literary sources, we have plenty of evidence that archers shot at close range.
This has been discussed before, by:
u/Badgerfest in https://www.reddit.com/r/AskHistorians/comments/7j9bdp/isnt_there_a_contradiction_between_descriptions/
u/Hergrim in https://www.reddit.com/r/AskHistorians/comments/6fn8je/were_bows_shot_straight_or_in_an_arc_in_warfare/
u/Hergrim also discussed artistic evidence for long-range shooting in https://www.reddit.com/r/AskHistorians/comments/72l2ju/did_archers_not_generally_use_indirect_volley_fire/ - this evidence suggests that the artwork linked above showing short-range shooting is genuinely showing short-range shooting, rather than simply being the way that all archery was depicted in art.
References:
Dzengseo (author), Nicola Di Cosmo (translator and editor), The diary of a Manchu soldier in seventeenth-century China: my service in the army, Routledge, 2006.
G. C. Hurst III, Armed Martial Arts of Japan: Swordsmanship and Archery, New Haven, Yale University Press, 1998.
Miyamoto Musashi, A Book of Five Rings, Woodstock, NY: Overlook, 1974.