Simplified (not really) the test uploading code.