PDA

View Full Version : [CLOSED] Opera and FileUpload



aisi_it_admin
Sep 18, 2012, 11:00 AM
Hello
are you aware of any problems with Opera and FileUpload control?

I'm getting the same problems like the one described in the
http://forums.ext.net/showthread.php?19841-CLOSED-Problem-under-Opera-last-version

Steps to reproduce are quite simple:


<ext:Window runat="server" Width="550" Height="100">

<Items>
<ext:FileUploadField runat="server" ID="fup"></ext:FileUploadField>
<ext:Button runat="server" OnDirectClick="btn_click"></ext:Button>
</Items>
</ext:Window>

(and defining empty server event)

I reproduced this on two computers, with latest opera installed
(opera 12 taken from http://www.opera.com/)

thanks

Daniil
Sep 18, 2012, 12:23 PM
Hi,

Could you, please, clarify what exactly happens on your side with Opera + FileUploadField combination?

aisi_it_admin
Sep 18, 2012, 1:01 PM
see the attachment, it appears after clickin the button

Daniil
Sep 18, 2012, 4:06 PM
Thank you.

Does it work with other major browsers? Please investigate requests. What is the difference?

aisi_it_admin
Sep 18, 2012, 7:11 PM
Yes, FF, Chrome and IE is fine
It works for you in opera? I tried on couple coputers, with latest opera and it does not work

Unfortunatelly I don't know how to push opera to log request in fiddler

Daniil
Sep 19, 2012, 7:52 AM
Unfortunatelly I don't know how to push opera to log request in fiddler

There is the built-in DragonFly, an analog of developer tools and FireBug.
http://www.opera.com/dragonfly/documentation/


Yes, FF, Chrome and IE is fine
It works for you in opera?

I reproduced it in Opera as well. Thank you for the report. There is a bug in ExtJS 4.1.1 which appears to be fixed in 4.1.2. Yesterday, we incorporate ExtJS 4.1.2 into the 2.1 branch. Please update.

Though, I think there is still an issue. I reported it to Sencha.
http://www.sencha.com/forum/showthread.php?243074

To fix it please use the following script for now.

Fix

<script type="text/javascript">
Ext.data.Connection.override({
onUploadComplete: function(frame, options) {
var me = this,
// bogus response object
response = {
responseText: '',
responseXML: null
}, doc, contentNode;

try {
doc = frame.contentWindow.document || frame.contentDocument || window.frames[frame.id].document;
// Opera will fire an extraneous load event on about:blank
// We want to ignore this since the load event will be fired twice
if (doc) {
if (Ext.isOpera && doc.location == 'about:blank') {
return;
}
if (doc.body) {

// Response sent as Content-Type: text/json or text/plain. Browser will embed in a <pre> element
// Note: The statement below tests the result of an assignment.
if ((contentNode = doc.body.firstChild) && /pre/i.test(contentNode.tagName)) {
response.responseText = contentNode.innerText;
}

// Response sent as Content-Type: text/html. We must still support JSON response wrapped in textarea.
// Note: The statement below tests the result of an assignment.
else if ((contentNode = doc.getElementsByTagName('textarea')[0])) {
response.responseText = contentNode.value;
}
// Response sent as Content-Type: text/html with no wrapping. Scrape JSON response out of text
else {
response.responseText = doc.body.textContent || doc.body.innerText;
}
}
//in IE the document may still have a body even if returns XML.
response.responseXML = doc.XMLDocument || doc;
}
} catch (e) {
}

me.fireEvent('requestcomplete', me, response, options);

Ext.callback(options.success, options.scope, [response, options]);
Ext.callback(options.callback, options.scope, [options, true, response]);

// If we get this far it means the load event has fired properly, so remove it
if (Ext.isOpera) {
Ext.fly(frame).un("load", this.onUploadComplete, this);
}

setTimeout(function() {
Ext.removeNode(frame);
}, 100);
}
});
</script>

Daniil
Dec 29, 2012, 9:12 AM
It should be fixed in SVN.

So, you can remove the suggested fix from the page.