The king informed Joseph that his innocence was established and ordered him to come to the palace for an interview. The king recognized his noble qualities. When Joseph came, the king spoke to him in his tongue. Joseph's replies astonished the king with his cultural refinement and wide knowledge.
Then the conversation turned to the dream. Joseph advised the king to start planning for years of famine ahead. He informed him that the famine would affect not only Egypt but the neighboring countries as well. The king offered him a high position. Joseph asked to be made controller of the granaries, so that he could guard the nation's harvest and thereby safeguard it during the anticipated drought. By this Joseph did not mean to seize an opportunity or personal gain; he merely wanted to rescue hungry nations for a period of seven years. It was a sheer self-sacrifice on his part.
Related Quran Ayaaths of this Hadith.
Surah 6 : Ayah 84 Surah 12 : Ayah 96 Surah 12 : Ayah 99 Surah 12 : Ayah 100 Surah 12 : Ayah 102 Surah 12 : Ayah 111"When a person dies, his works end, except for three: ongoing charity, knowledge that is benefited from, and a righteous child who prays for him."
Prophet Mohammed (PBUH)
"The best of what a man leaves behind are three: a righteous child who supplicates for him, ongoing charity the reward of which reaches him, and knowledge that is acted upon after him."
Sunan Ibn Mājah
"Every day two angels come down from Heaven and one of them says, 'O Allah! Compensate every person who spends in Your Cause,' and the other (angel) says, 'O Allah! Destroy every miser.'"
Sahih Bukhari