properly handle case when user wants to cancel file upload