The male victim was struck at Gillman Avenue and Bill Walsh Way at about 1:30 p.m., Officer Gordon Shyy said.
He suffered minor cuts and was treated at the scene by medical personnel, Shyy said.
No one was arrested and the incident was being investigated, he said.
The attack was not related to a San Francisco 49ers game that was in progress at the time, Shyy said.