A highly sensitive light-driven switch assembled by Al-doped zinc oxide (AZO) nanofibers was prepared by electrospinning. Uniform electrospun porous AZO nanofibers with an average diameter of 170 nm were observed by scanning electron microscopy and transmission electron microscopy. The small radii of Al3+ and Zn vacancies occupied in the zinc oxide crystal lattice resulted in small crystal grains and a large band gap of AZO nanofibers. The reversible and enhanced photocurrent illustrated a strong Al content dependence. A photoswitch based on AZO nanofibers with an Al dopant concentration of 1 atm. % showed the highest on/off ratio of 30 after 20 cycles due to excited excitons at the defect level illuminated by the simulated solar light. The decay of the photocurrent under long time illumination was affected by the adsorption to defects. High sensitivity and enhanced photocurrent put a insightful understanding of writable photoswitches or memories using electrospun AZO nanofibers.