PDA

View Full Version : filefield Upload localhost domain



Carlos.D
2 Nov 2012, 8:44 AM
Hi,
I get an Javascript error : "
Unsafe JavaScript attempt to access frame with URL data:text/html,chromewebdata from frame with URL
http://localhost/myprojet/ (http://localhost/holodev/app-manager/)
. Domains, protocols and ports must match."

The error come form :
ext-all-debug.js:37725


doc = frame.contentWindow.document || frame.contentDocument || window.frames[frame.id].document;



When a try to use the sample upload file from ext 4.1.1 :




launch :function(){
Ext.create('Ext.form.Panel', {
title: 'Upload a Photo',
width: 400,
bodyPadding: 10,
frame: true,
renderTo: Ext.getBody(),
items: [{
xtype: 'filefield',
name: 'file',
fieldLabel: 'photo',
labelWidth: 50,
msgTarget: 'side',
allowBlank: false,
anchor: '100%',
buttonText: 'Select Photo...'
}],


buttons: [{
text: 'Upload',
handler: function() {
var form = this.up('form').getForm();
if(form.isValid()){
form.submit({
url: './database/customRequest.php?ACTION=UPLOADFILE',
waitMsg: 'Uploading your photo...',
success: function(fp, o) {
Ext.Msg.alert('Success', 'Your photo "' + o.result.file + '" has been uploaded.');
}
});
}
}
}]
});


}


Any ideas, how can solve this ?

mitchellsimoens
5 Nov 2012, 6:28 AM
Do you have your app within an iframe?

Carlos.D
5 Nov 2012, 8:02 AM
No I juste run the sample from the documentation.