Due to the small valence band discontinuity (AEV) of 0.37 eV at NiO/Si interface, the p-NiO/n-Si heterojunction photodiodes exhibit a large dark current and visible response, causing a poor ultraviolet (UV) detection. In this study, the zinc-oxide (ZnO) hole blocking layer was sandwiched in between p-NiO and n-Si. The ZnO/Si interface possesses a large AEV of 2.6 eV, which retards the photogenerated holes in Si from entering ZnO and largely enhances the UV response, thus improving the performance of UV photodectors. The ZnO sandwich layer in-creases UV response due to its wide bandgap (3.27 eV). In the p-NiO/n-Si heterojunction photodiodes (HPDs) without ZnO, the photocurrent is less dependent on bias voltage; however, the photocurrent increases with bias voltage after sandwiching the ZnO layer. The ZnO sandwich layer drastically suppresses dark current by approximately two orders, hence enhancing the photo/dark current ratio from 11.5 to 5010. The UV/visible rejection ratio is smaller than 200 and less dependent with bias voltage in p-NiO/n-Si HPDs. Nevertheless, the UV/visible ratio is greater than 700 and increases with bias voltage in the HPDs with ZnO sandwich layer. Also, the ZnO layer drastically increases the detectivity from 1.8 x 1010 to 3.3 x 1012 Jones. X-ray photoelectron spectroscopy reveals the defect states in NiO are suppressed by ZnO layer and thus a different carrier conduction. Band diagram illustrates a significant valence-band discontinuity at ZnO/Si interface, which blocks the photo -generated holes in n-Si from entering n-ZnO, thereby suppressing the visible response from n-Si. Additionally, the UV response is enhanced by the wide bandgap ZnO layer and the UV response increases with increasing bias voltage.