EXTjs Requestcomplete getresponseheader is undefined


#1

Try to upload a file using EXTjs and when recive responde the method xhr.getRespondeHeader in includes javascript (line 494) is undefined.

Javascript:

var uploadForm = Ext.create('Ext.form.Panel', {
                width: 500,
                frame: true,
                bodyPadding: '10 10 0',
                defaults: {
                    anchor: '100%',
                    allowBlank: false,
                    msgTarget: 'side',
                    labelWidth: 50
                },
                items: [{
                    xtype: 'filefield',
                    name: 'File1'
                }, {
                    xtype: 'filefield',
                    name: 'File2'
                }],
                buttons: [{
                    handler: function () {
                        var uploadForm = this.up('form').getForm();
                        if (uploadForm.isValid()) {
                            uploadForm.submit({
                                url: 'UploadRPI',
                                success: function (fp, o) {
                                },
                                failure: function () {
                                }
                            });
                        }
                    }
                }]
            });

Chrome packages

1.     Request URL:
http://localhost/API/rpi/UploadRPI
2.     Request Method:
POST
3.     Status Code:

200 OK
4.     Request Headersview source
1.     Accept:
text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
2.     Accept-Charset:
ISO-8859-1,utf-8;q=0.7,*;q=0.3
3.     Accept-Encoding:
gzip,deflate,sdch
4.     Accept-Language:
pt-BR,pt;q=0.8,en-US;q=0.6,en;q=0.4
5.     Cache-Control:
no-cache
6.     Connection:
keep-alive
7.     Content-Length:
48826573
8.     Content-Type:
multipart/form-data; boundary=----WebKitFormBoundary79RSDxw9zI4WeXM2
9.     Cookie:
SecurityToken=2027fefe-880a-449e-a853-ed9dce7a827e; ASP.NET_SessionId=fdxrmtoguzdp3u2btlwses2t; Language=pt-BR
10.   Host:
localhost
11.   Origin:
http://localhost
12.   Pragma:
no-cache
13.   Referer:
http://localhost/API/rpi/StepDownload
14.   User-Agent:
Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.83 Safari/537.1
5.     Request Payload
1.   ------WebKitFormBoundary79RSDxw9zI4WeXM2 Content-Disposition: form-data; name="rpiNumber" 2174 ------WebKitFormBoundary79RSDxw9zI4WeXM2 Content-Disposition: form-data; name="Patent"; filename="PATENTES2174.pdf" Content-Type: application/pdf ------WebKitFormBoundary79RSDxw9zI4WeXM2 Content-Disposition: form-data; name="Marca"; filename="marcas2174.pdf" Content-Type: application/pdf ------WebKitFormBoundary79RSDxw9zI4WeXM2--
6.     Response Headersview source
1.     Cache-Control:
private
2.     Content-Length:
5
3.     Content-Type:
application/json; charset=utf-8
4.     Date:
Wed, 05 Sep 2012 15:45:39 GMT
5.     Server:
Microsoft-IIS/7.5
6.     X-AspNet-Version:
4.0.30319
7.     X-AspNetMvc-Version:
3.0
8.     X-MiniProfiler-Ids:
["df9582ef-e4b2-4589-ba9e-1b2eb17fefde"]
9.     X-Powered-By:
ASP.NET
 
 
 
 
Response : false

#2

Any upload file using hidden iframe will have the same problem, because the xmlHttpRequest does not exists.
But the miniprofiler should skip the profiling and not break the Javascript Event firing

Solution is check xhr.getResponseHeader before call method