valli valli - 4 years ago 1321
Javascript Question

extjs file uploads through form submit for cross domain

I would like to upload files to cross domain server from using

form.submit()
method. When i call
form.submit()
, request is going to my restful web service and file is getting uploaded successfully. But the response is blocked at the browser with message: Blocked a frame with origiā€¦host:1841" from accessing a cross-origin frame.

From older posts and form submit code, i found that
doSubmit()
is sending the Ajax request with out
cors:true
statement due to which cross domain response is blocked.

I thought of sending normal Ajax request but dont know how the file data can be read and send to server through ajax request.

Is there anyway in to send the file data to server as
form.doSubmit()
does? Can someone help me on this problem?

Thanks.

Solution is: What does document.domain = document.domain do? and http://codeengine.org/extjs-fileuplaod-cross-origin-frame/

Answer Source

Ajax call does not work with downloading and i presume with uploading files.

Have you tried to set this before doSubmit:

Ext.Ajax.cors = true;
Ext.Ajax.useDefaultXhrHeader = false;
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download