Attosecond science has been transforming our understanding of electron dynamics in atoms, molecules, and solids. However, to date almost all of the attoscience experiments have been based on spectroscopic measurements because attosecond pulses have intrinsically very broad spectra due to the uncertainty principle and are incompatible with conventional imaging systems. Here we report an important advance towards achieving attosecond coherent diffractive imaging. Using simulated attosecond pulses, we simultaneously reconstruct the spectrum, 17 probes, and 17 spectral images of extended objects from a set of ptychographic diffraction patterns. We further confirm the principle and feasibility of this method by successfully performing a ptychographic coherent diffractive imaging experiment using a light-emitting diode with a broad spectrum. We believe this work clears the way to an unexplored domain of attosecond imaging science, which could have a far-reaching impact across different disciplines.