I've read a lot of posts about the "Upload Failed" messages. I couldn't get it work for days of research until you published the correction with change set 9167.
I think you should write somewhere that this solves the issue. Judging by the modifications, you were writing the debug file even if no right was granted on the root folder.
Thank you for this update, it now works without having to use the HttpHandler, and it by far better.