The growth of quaternary AlInGaN epitaxial layer on GaN/sapphire substrates by metalorganic chemical vapour deposition is reported. It was found that AlInGaN layers were grown three dimensionally with rough surface at low temperatures and transferred to smooth two-dimensional growth at 860degC. It was also found that In mole fraction in the layers decreased significantly as the AlInGaN growth temperature was increased while Al composition ratio was much less temperature dependent. Furthermore, it was found that solar-blind metal-insulator-semiconductor photodetectors with AlInGaN layer prepared at 860degC could provide us a photocurrent-to-dark-current contrast ratio of 1.93X104 and a UV-to-visible rejection ratio of 38.0.