The characters combine literally to mean “visit up.” This perfectly describes the act of going up the chain of command to make a formal visit of appeal.
“Shàngfǎng” is a deeply ingrained concept in Chinese political culture with no perfect Western equivalent. It's the modern manifestation of a tradition stretching back to imperial China, where any subject, in theory, could submit a petition to the emperor to report corrupt local mandarins.
Shàngfǎng is a serious term, almost exclusively used in the context of political and social grievances. You would never use it for a complaint about a faulty product or bad service.