Added comprehensive error message when upload fails.