An upper endoscopy allows the doctor to look inside the esophagus, stomach and the duodenum. The doctor can see abnormalities such as inflammation and bleeding.