ZnO thin films were deposited by RF magnetron sputtering on glass substrates, and the Au-ZnO-Au ultraviolet photodetectors were fabricated. The effects of annealing temperature on the properties of ZnO thin films and ultraviolet photodetectors were investigated, systematically. The results show that ZnO film has a c-axis preferred orientation, the resistivity and the carrier concentration of thin film can be effecttively improved from changing annealing temperature. The average transmittance of ZnO is above 85 % in the visible range and the strong absorption of ultraviolet light can be observed. After annealing at 500°C, the dark current and photocurrent of photo-detectors can reach $1.5 \mu A$ and 3.6 mA at 10 V bias respectively.