Using data from the HEGRA air shower array , taken in the period from April 1998 to March 2000 , upper limits on the ratio I _ { \gamma } / I _ { CR } of the diffuse photon flux I _ { \gamma } to the hadronic cosmic ray flux I _ { CR } are determined for the energy region 20 TeV to 100 TeV . The analysis uses a gamma-hadron discrimination which is based on differences in the development of photon- and hadron-induced air showers after the shower maximum . A method which is sensitive only to the non-isotropic component of the diffuse photon flux yields an upper limit of I _ { \gamma } / I _ { CR } ( at 54 TeV ) < 2.0 \times 10 ^ { -3 } ( at the 90 % confidence level ) for a sky region near the inner galaxy ( 20 ^ { \circ } < galactic longitude < 60 ^ { \circ } and | galactic latitude | < 5 ^ { \circ } ) . A method which is sensitive to both the isotropic and the non-isotropic component yields global upper limits of I _ { \gamma } / I _ { CR } ( at 31 TeV ) < 1.2 \times 10 ^ { -2 } and I _ { \gamma } / I _ { CR } ( at 53 TeV ) < 1.4 \times 10 ^ { -2 } ( at the 90 % confidence level ) .