Pharaoh said to Joseph, "I had a dream, and no one can interpret it. But I have heard it said of you that when you hear a dream you can interpret it."
"I cannot do it," Joseph replied to Pharaoh, "But God will give Pharaoh the answer he desires."
Joseph's entire life is defined by integrity and humility. He never thinks of himself as more than he is. He is more careful to be pure than to be thought pure, as was the case with the Potiphar's wife. And so even as he was considered the least of all his brothers, so now will he become the greatest. Because he was humble? No. Because God was with him and gave him success in all that he did. Humility is the attitude that allows God to do what God does naturally.
Joseph understands that if it were not for God, he could do nothing in this situation. And rather than take credit for something he could not actually do, he gives the credit to God. This is humility, the ability to acknowledge one's own position in relation to God.
If a man were to give you a compliment, do not let it go to your head and inflate your ego. Rather thank God who gives you all things. After all, you did not make yourself.