3

I am using File uploading component for Sencha Touch to upload image in my sencha project. Its working fine. But when i am trying to upload the image from another domain it gives

Uncaught SecurityError: Failed to read the 'contentDocument' property from 'HTMLIFrameElement': Blocked a frame with origin "http://localhost" from accessing a frame with origin "http://192.168.1.45". Protocols, domains, and ports must match. error.

The issue is very clear, so i have tried by using header('Access-Control-Allow-Origin: *'); and also tried <script type="text/javascript">document.domain = '*';</script>(Both together and also differently) but nothing happens. ref

Basically the php file which is responsible for image uploading is working properly for a result image is successfully uploaded but after that the json data is not returning in sencha, so that's causes the error.

Here is the screenshot

enter image description here

Please help me to fix this.

Thank You...

Community
  • 1
  • 1
Sudipta Dhara
  • 608
  • 1
  • 5
  • 21

1 Answers1

0

Another one: If you load up a file from your "local" filesystem, it is not where the PHP is running. PHP is in the server you got the JS from to your Browser ... So a Allow-Origin in the PHP File isn't useful. It would only be useful, if you would try to upload a file from the server to your client device the Browser is running on. Let me know what is your solution - I am snoopy ;)