Sencha Touch file upload issue
I am using File Upload for Sencha Touch to upload an image in my sencha project. His work is wonderful. But when I try to load an 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.
mistake.
The problem is very clear, so I tried using header('Access-Control-Allow-Origin: *');
and also tried <script type="text/javascript">document.domain = '*';</script>
(both together and also in a different way), but nothing happens. ref
Basically the php file that is responsible for loading the images is working correctly and the result of the image is loading successfully, but after that the json data is not returned to sencha, so this throws an error.
Here is a screenshot
Please help me fix this.
Thank...
source to share
Another: if you download a file from your "local" filesystem, this is not where PHP runs. PHP is on the server where you sent the JS from your browser ... So Allow-Origin in the PHP file is not useful. It would be helpful if you try to download a file from the server to a client device that is running a browser. Let me know what your solution is - I'm snoopy;)