This deleting the upload directory could be called via defer and the OnExit framework - see here for an example    https://github.com/rclone/rclone/blob/9ea990d5a29fb74fbb28855577aa77e0e3c1ceb9/backend/s3/s3.go#L2262-L2274    When rclone supports resuming uploads this will have to change...  