Next, through an ion exchange process between the hydrogen ions of carboxylic groups and Ag ions, Ag ions were enriched in the polymer fibers and then they were in situ reduced to Ag(0) via a photochemical reduction reaction. To confirm that Ag NCs were prepared successfully by the template of electrospun polymer fibers, the XPS spectroscopy was performed. The XPS spectra of Ag 3d region ( Fig. 2a) show that the typical peak at 368–369 eV has a little blue shift (from 368.50 eV to 368.35 eV), which supports the fact that Ag(I) ions have been reduced to Ag(0). Fig. 2b shows the UV–vis absorption spectra of the Ag(I)-rich electrospun polymer fibers before and after they were exposed to a UV lamp. Obviously, no peak can be observed in the range of 400 to 700 nm before UV light irradiation. After exposing the fibers to UV light for 100 min, a wide peak centered at 450–470 nm associated with Ag2–8 NCs appeared [33], which indicates the formation of Ag NCs. We also employed the EDX analysis to prove the existence of Ag in the electrospun polymer fibers (see Supplementary material).