Handle HTTP redirects and HTTP errors in URL upload from f76d25e.