Improving the error reporting and checking that local files exist before attempting to upload.