I commented out the line:
response = (HttpWebResponse)webrequest.EndGetResponse(asynchronousResult);
plus a few other associated lines and at least now it doesn't crash.
It uploads the files correctly and still occasionally does not upload a file like it did with IE7.
It would be nice to know wht the files don't get uploaded occasionally.