test upload success and failure logic