- addListener(req.upload, 'load', function(evt){self.uploadCompleteHandler(evt);});
-
- req.open("PUT", this.uploadUrl); // + '/' + file.name);
+ // addListener(req.upload, 'load', function(evt){self.uploadCompleteHandler(evt, req);});
+ addListener(req, 'readystatechange',
+ function(evt) {
+ if (req.readyState == 4) {
+ self.uploadCompleteHandler(req);
+ }
+ });
+
+ req.open("PUT", this.uploadUrl);