We used to pray with the Messenger of Allah ﷺ in intense heat, and when one of us was unable to press his forehead against the ground, he would spread out his garment and prostrate upon it.
كنا نصلي مع رسول الله ﷺ في شدة الحر، فإذا لم يستطع أحدنا أن يمكن جبهته من الأرض، بسط ثوبه، فسجد عليه.
Bukhari reported it in the Book of Prayer Times (542), and Muslim in the Book of Mosques (620), both through the route of Ghalib al-Qattan, from Bakr bin Abdullah, from Anas bin Malik, and he mentioned the hadith. The wording given is Muslim's, while Bukhari's wording is, "When we prayed behind the Messenger of Allah ﷺ during the midday heat, we would prostrate on our garments as protection from the heat." He also reported it in the Book of Prayer (385) and in the Book of Actions During Prayer (1208), both times through the route of Ghalib with similar wording.Abu Yaala also reported it through this same route in his Musnad, Maqsad Ali, number 185, where Anas said, "We used to pray with the Messenger of Allah ﷺ during intense heat, and one of us would take pebbles in his hand, and once they cooled he would put them down and prostrate on them."Ghalib is Ibn Khattaf, with the dotted letter vowelled with a dammah, though it has also been said with a fathah, and he is Ibn Abu Ghaylan al-Qattan, Abu Sulayman al-Basri. Bakr bin Abdullah is al-Muzani, Abu Abdullah al-Basri.This hadith provides evidence that it is permissible for one praying to prostrate on the garments covering his own body, and this is the position held by the majority of jurists. Shafii did not permit this, and he interpreted the hadith as referring to a garment that is not being worn by the person, and support for his view comes from the coming hadith of Jabir bin Abdullah. For had it been permissible to prostrate on a garment one is actually wearing, there would have been no need to cool the pebbles in the palm of the hand.