In this letter, highly porous ZnO film with a considerable thickness about 35 μm was prepared by electrodeposition with ZnO nanoparticles dispersed in ZnO electrolyte, which was also known as occlusion electrosynthesis (OE). The ZnO/CdS photoelectrode with the ZnO film prepared by OE showed far more superior optical and photoelectrochemical performance to that with the ZnO film prepared by electrodeposition without ZnO nanoparticles dispersed in electrolyte (ED). Since ZnO nanoparticles can be separately prepared, optimized and tailored prior to OE process, it is expected to prepare porous ZnO film by OE with various morphology and properties for specific application at low temperature, especially for flexible devices.