I felt perfectly safe in Shanghai; it is no different than any large city and better China tours than most. Foreign tourists have very few problems if they behave respectfully. The police don't put up with any nonsense, and if you are harassed or mugged and can get to a phone, dial 110 (the police emergency number), an officer will show up within five minutes. Or so I'm told.
Just use your common sense. Don't go places after hours alone if you're a woman, and try not to take taxis after 11pm, not because they will do anything bad but because after 11pm, the cabs charge Yangtze River cruises twice the daytime rates. Take a map and get your bearings before going anywhere; Shanghai is a pretty easy city to learn.
Pickpockets are notoriously competent in China. I carried only as much money as I thought I'd spend, and kept a smaller amount in a pocket to pull out for fares, incidental purchases, etc. Just don't flash money around. These are all travel to Shangri-la precautions you'd take in any large city.
Welcome to FC2!