Load XML file from addon domain without cross-domain Policy file

Hello.
Assuming that there are two addon domains on the same server: /public_html/domain1.com       and      /public_html/domain2.com
I try to load XML file from domain2.com into domain1.com without using cross-domain policy file (since it doesn’t work on xml files in my case).
So the idea is to use php file in order to load XML and read it back to flash.
I’ve found an interesting scripts that seems to do the job but unfortunately I can't get it to work. In my opinion there is somewhere problem with AS3 part. Please take a look.
Here are the AS3/PHP scripts:
AS3 (.swf in www.domain1.com):
// location of the xml that you would like to load, full http address
var xmlLoc:String = "http://www.domain2.com/MyFile.xml";
// location of the php xml grabber file, in relation to the .swf
var phpLoc:String = "loadXML.php";
var xml:XML;
var loader:URLLoader = new URLLoader();
var request:URLRequest = new URLRequest(phpLoc+"?location="+escape(xmlLoc) );
loader.addEventListener(Event.COMPLETE, onXMLLoaded);
loader.addEventListener(IOErrorEvent.IO_ERROR, onIOErrorHandler);
loader.load(request);
function onIOErrorHandler(e:IOErrorEvent):void {
    trace("There was an error with the xml file "+e);
function onXMLLoaded(e:Event):void {
    trace("the rss feed has been loaded");
    xml = new XML(loader.data);
    // set to string, since it is passed back from php as an object
    xml = XML(xml.toString());
    xml_txt.text = xml;
PHP (loadXML.php in www.domain1.com):
<?php
header("Content-type: text/xml");
$location = "";
if(isset($_GET["location"])) {
    $location = $_GET["location"];
    $location = urldecode($location);
$xml_string = getData($location);
// pass the url encoded vars back to Flash
echo $xml_string;
//cURLs a URL and returns it
function getData($query) {
    // create curl resource
    $ch = curl_init();
    // cURL url
    curl_setopt($ch, CURLOPT_URL, $query);
    //Set some necessary params for using CURL
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
   //Execute the curl function, and decode the returned JSON data
    $result = curl_exec($ch);
    return $result;
    // close curl resource to free up system resources
    curl_close($ch);
?>

I think you might be right about permissions/settings on the server for php. Unfortunately I'm not allowed to adjust them.
So I wrote my own script - this time I used file path instead of http address of the XML file.  It works fine in my case.
Here it is:
XML file on domain2.com:
<?xml version="1.0" encoding="UTF-8"?>
<gallery>
    <image imagePath="galleries/gallery_1/images/1.jpg" thumbPath="galleries/gallery_1/thumbs/1.jpg" file_name= "1"> </image>
    <image imagePath="galleries/gallery_1/images/2.jpg" thumbPath="galleries/gallery_1/thumbs/2.jpg" file_name= "2"> </image>
    <image imagePath="galleries/gallery_1/images/3.jpg" thumbPath="galleries/gallery_1/thumbs/3.jpg" file_name= "3"> </image>
</gallery>
swf  on domain1.com:
var imagesXML:XML;
var variables:URLVariables = new URLVariables();
var varURL:URLRequest = new URLRequest("MyPHPfile.php");
varURL.method = URLRequestMethod.POST;
varURL.data = variables;
var MyLoader:URLLoader = new URLLoader;
MyLoader.dataFormat =URLLoaderDataFormat.VARIABLES;
MyLoader.addEventListener(Event.COMPLETE, XMLDone);
MyLoader.load(varURL);
function XMLDone(event:Event):void {
    var imported_XML:Object = event.target.data.imported_XML;
    imagesXML = new XML(imported_XML);
   MyTextfield_1.text = imagesXML;
   MyTextfield_2.text = imagesXML.image[0].attribute("thumbPath");  // sample reference to attribute "thumbPath" of the first element
php file on domain1.com:
<?php
$xml_file = simplexml_load_file('../../domain2.com/galleries/gallery_1/MyXMLfile.xml');  // directory to XML file on the same server
$imported_XML = $xml_file->asXML();
print "imported_XML=" . $imported_XML;
?>
Regards
PS: for those who read the above discussion: the first and the second script work but you must test which one is better in your situation. The first script will also work between two domains on different servers. No cross domain policy file needed.

Similar Messages

  • Restoring backup files from Time Machine without system preference/Library files

    Hi all. I recently ran into some trouble with my MBP and had the Apple store do a erase/install for me. At the time when I got my laptop back, I was told it would be best if I transferred my files including applications the drag and drop way to avoid restoring library/system files that could've been the cause of the problem in the first place. I'm currently still at the setup assistant stage and I'm really unsure of what to do to be honest because I'm under the impression that my application settings would pretty much be gone if I did the drag and drop method.
    I read that setup assistant transfers only files that you want but I also read something from user Pondini that the Library files are automatically restored even if I unchecked everything. Which is problematic since that's what I want to avoid in the first place. If possible can anyone recommend a better option for my dilemma? I've read in one of the forum boards that dragging and dropping files can also cause some problems with how applications will work and I really don't want to have to deal with that after the trouble I'm going through with this. Is there a way to just restore Applications and the user folder (desktop, documents, downloads, etc) without including the library system files and folders through setup assistant?
    Or do I really have to deal with dragging and dropping files instead? Would you recommend doing the stars wars method of Time Machine and picking only the files I want? Would that be most advisable?
    Also, it would be really helpful if anyone can explain to me what the "other files and folders" mean exactly. Thanks very much!

    Well what happened was my laptop ran into 2 kernel panics within 2 days (I posted a question here: https://discussions.apple.com/message/25605663#25605663). Which sent ME into a panic. I couldn't trust myself to go any further so I went to the Apple store who then helped did an erase/install for me because they suspect it could be a software issue (maybe it was missing codes or something) and suggested that it would be best for me to drag/drop restore my stuff manually. I'm not very keen on a full system restore either because I know there are some system files which I'd rather not have sticking around (like com.rims which are super stubborn to get rid of) and which could even have been the source of my trouble right now.
    I was reading through every single page of Pondini's articles and I'm couldn't find anything which said I could just restore the apps in my apps folder without transferring anything else (ie. the library folder in the macintosh hd folder) since i'm assuming anything from the library folder of the user would be obsolete if I choose not to restore those files using setup assistant. But I'm more reluctant about not using setup assistant for restoring my apps because I don't know how bad it will turn out. Not to mention I won't know if they would restore system root files that should've been long gone since I uninstalled them.

  • Error loading XML Document from /analytics/saw.dll/common/privileges.xml

    I tested my procedure for upgrading from OBI 11.1.1.5 to 11.1.1.6 which was successful. I had to rollback to OBI 11.1.1.5 using my database backup and VM snapshot due to project requirements.
    The OBI application successfully comes up but users who login just get "Error loading XML Document from /analytics/saw.dll/common/privileges.xml?fmapID=KqIJCw. The response given was: ". They can't close this message box so are unable to do anything.
    How can I fix this?

    Hi All,
    You can face this issue with other versions of OBIEE 11.*
    Problem cab be solved as follows:
    Go to http://localhost:7001/em  > coreapplication > Capacity Management > Scalibility >
    1. Lock and edit
    2 .increase number of presentation services to 2
    3. restart opmn component.
    Go to coreapplication > Availibility > processes
    1 .please note that in deployment > catalog > change path of catalog field from $coreapplication to path where your catalog resides.
    2. Take down your primary instance.
    3. As your secondary is up, it will grant you to browse you through catalog and dashboards.
    If you want to run primary instance of presentation services
    Go to path \Middleware\instances\instance1\bifoundation\OracleBIPresentationServicesComponent\coreapplication_obips2
    except catalog and catalog manager > Copy all other files to coreapplication_obips1
    restart opmn component > problem solved.!!!
    Regards,
    Akshay S.
    please like if you find it helpful

  • HT201250 Can I restore photo files from Time Machine without the use of an external drive?  I'm trying to restore lost photo files and I see them listed in Time Machine (without use of an external drive), but when I try to restore I get a error code 36.

    Can I restore photo files from Time Machine without the use of an external drive?  While I was transferring photos back and forth from a thumb drive something went haywire and my IPhoto was wiped clean!  When I click on Time Machine I see all the dated pages (without an external storage drive connected), go back to a date where all my photo files are there, click "restore", and I get the message:  "The Finder can't complete the operation because some data in file cant be read or written (error code - 36)"

    Thanks so much Terence.  I tried some of the fixes from that page, but then discovered the suggestion to compress the Time Machine Back up of the original library and transfer it as a zip back to my computer as detailed here:
    http://pondini.org/TM/E9.html
    That worked like a charm.  I really appreciate it. 

  • I have an alias of one of my external hard drives in my trash. When I click on "show original" all my external H D 's and my Mac hard drive show up. How do I delete this icon from the trash without loosing all my files?

    I have an alias of one of my external hard drives in my trash. When I tried to delete it, it showed that I was deleting 80,000 files and counting. I stopped the delete process and when I clicked on "show original" all my external H.D.'s and my Mac hard drive show up. How do I delete this alias from the trash without loosing all my files? When I tried to drag it back to the desk top, it just made a duplicate and remained in the trash. When I turned off the external H.D., the trash was then empty. Tried rebooting the computer and then turning the external hard drive back on and the alias shows up in the trash again. Much help appreciated.
    Rich

    In Finder's Menu, select Go menu>Go to Folder, and go to "/volumes". (no quotes)
    Volumes is where an alias to your hard drive ("/" at boot) is placed at startup, and where all the "mount points" for auxiliary drives are created for you to access them. This folder is normally hidden from view.
    Drives with an extra 1 on the end have a side-effect of mounting a drive with the same name as the system already think exists. Try trashing the duplicates with a 1 or 2 if there are no real files in them, and reboot.
    If it does contain data...
    http://support.apple.com/kb/TS2474

  • How to display a file from Application server without downloading it to local drive

    I want to dispaly a file from Application server without downloading it to my local system.
    i tried the below method but it didn't work.
         CALL METHOD CL_GUI_FRONTEND_SERVICES=>EXECUTE
          EXPORTING
            APPLICATION            = L_FILE
            DEFAULT_DIRECTORY      = L_DIR

    Hi,
    Use open dataset to read file from application server.
    try like this sample code:
    data : p_file like ibipparms-path.
    data : rec(350) type c.
    data:  g_delimiter(1) type c value ','.
    maintain the file path in p_file. then
    open dataset p_file for input in text mode encoding default.
       IF SY-SUBRC = 0.
    do n times.
    READ dataset p_file into rec.
    split rec at g_delimiter into your internal table fields like it-id it-name it-age.
    append it.
    clear it.
    enddo.
    close dataset p_file.
    Now you have the data in internal table it.

  • Creating new analysis gives "Error loading XML Document from ..."

    Trying to create analysis and getting "Error loading XML Document from saw.dll/answers/answersproperties.xml?fmapId=S1clug.
    The response given was:" after choosing subject area. Analysis editor is opened but Subject Areas is empty and can't do anything.
    The problem is on Mozilla 12 (16.0.2, 17.0.1) and IE 8. Chrome works fine.
    My system is Win 7, BI 11.1.1.6.0 is on Oracle Linux (and by the way Mozilla from Linux system works fine)
    What could be the reason of this?
    Edited by: 898973 on 4/12/2012 15:11

    Reinstalling Mozilla with "Remove personal data" option checked resolved the problem.

  • HT204025 Can I remove files from my computer without removing them from iCloud?

    Can I remove files from my computer without removing them from iCloud?

    Reason I'm asking: I did move a folder over, and then went to iCloud.com, and looked in that folder, and it said it was empty. Thanks
    When you move a folder to iCloud Drive, it will upload the contents of this folder to iCloud Drive, but it may take a long tome, even for small items. You may see progress bars, while the contents is uploading.  And the folder may look empty, until it will be updated from iCloud.  For example - shortly after adding the folder "neueBilder" to iCloud Drive.

  • Load xml document from CLOB

    I'm try to load xml document from CLOB in following way:
    --- procedure loadXML.sql -----
    CREATE OR REPLACE PROCEDURE loadXML
    IS
    CONTENT CLOB := ' ';
    SOURCE bfile := BFILENAME('XMLFILES', 'N_95_A.xml');
    begin
    DBMS_LOB.OPEN(SOURCE, DBMS_LOB.LOB_READONLY);
    DBMS_LOB.loadFromFile(CONTENT, SOURCE, DBMS_LOB.getLength(SOURCE));
    DBMS_LOB.fileClose(SOURCE);
    insert into OFERTY (OFDOCUMENT)
    values (sys.XMLtype.createXML(CONTENT));
    commit;
    end;
    and I get
    SQL> @e:\myxml\loadXML
    declare
    ERROR at line 1:
    ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML processing
    LPX-00210: expected '<' instead of '<'
    ORA-06512: at "SYS.XMLTYPE", line 0
    ORA-06512: at line 1
    ORA-06512: at line 8
    What is wrong?

    Have you tried simply outputting iusing the htp.p function? for example:
    /* ... inside a PL/SQL region */
    declare
       lclb_output clob;
    begin
       select doc_xml into lclb_output from mf_xml_docs where doc_id = :P1_DOC_ID;
       htp.p(lclb_output); -- you may have to split this into chunks and loop through, depending on how big the clob is
    end;

  • If you delete files from your computer, BlackBerry Link deletes the file or collection from your device?

    I found the below description from the help of BlackBerry Link, however i never get it work.
    Any one know whats wrong or what i need to set?
    About deleting music, pictures, videos, and documents?
    After you sync your music, picture, video, or document files between your computer and your BlackBerrydevice, if you delete a file or a collection of files, the following actions occur:
    If you delete files from your computer, BlackBerry Link deletes the file or collection from your device.
    If you delete files from your device, BlackBerry Link doesn't delete the file or collection from your computer.
    For information about how to delete a file from your device, tap the Help app on the home screen of your device.

    Hey hkfoolman,
    Welcome to the BlackBerry Support Community Forums.
    Thanks for the question.
    Go into BlackBerry Link and click on the BlackBerry and then click on Options.  Make sure you have Music, Pictures, Videos and Documents checkmarked for synchronization.  Once these are checked, try to remove the files.
    Let me know if you have any more questions.
    Cheers.
    -ViciousFerret
    Come follow your BlackBerry Technical Team on Twitter! @BlackBerryHelp
    Be sure to click Like! for those who have helped you.
    Click  Accept as Solution for posts that have solved your issue(s)!

  • How to make Finder NOT to show files from a specific folder in "All My Files"?

    Hello!
    Can someone please advice how to make finder NOT to show files from a specific folder in "All My Files"? See the attach - I recently installed Civilization 5 from Steam and now I have a lot of unneeded files (*.log and *.ini) shown in  All My Files colder in Finder.
    I don't want to see them. Any advise?

    Using "All my Files" was very handy before all this rubbish popped up. =(

  • Good afternoon ladies and gentlemen!   My question concerns the impossibility to open RAW-files directly from the program Adobe Bridge. At the moment when you open a RAW-file from Adobe Bridge by double-clicking, RAW-file is opened only in Photoshop. In t

    Good afternoon ladies and gentlemen!
    My question concerns the impossibility to open RAW-files directly from the program Adobe Bridge. At the moment when you open a RAW-file from Adobe Bridge by double-clicking, RAW-file is opened only in Photoshop. In the settings Adobe Bridge - in "open RAW-files by double-clicking in Adobe Camera Raw» box is checked. When you try any changes in the settings Adobe Bridge system displays a message:
    Bridge's parent application is not active. Bridge requires that a qualifying product has been launched at least once to enable this feature.
    The entire line of Adobe products on my computer updated to the latest updates. Previously, a family of products Adobe Photoshop on your computer is not set. Computer - PC, Windows 7 Enterprises.

    <moved from Adobe Creative Cloud to Bridge General Discussion>

  • I can't export any files from pages unless I create a duplicate file. I can't export to doc, docx or pdf! Heeeelp!

    I can't export any files from pages unless I create a duplicate file. I can't export to doc, docx or pdf! Heeeelp!

    what version of pages?
    what is the files type that you are trying to export?
    what do you mean unless I create a duplicate file? the whole point of export is that you get a new file with a new format

  • How do I get files from multiple DVDs that are using thesame file names?

    How do I get files from multiple DVDs that are using thesame file names? Message says "file already exists in catalog"
    Message was edited by: marcr56

    marcr56
    I am viewing your question from different perspective, that is, the issue that you face when you are ripping VOBs from a second DVD-VIDEO on DVD disc using Premiere Elements,
    It is best to give the Premiere Elements version and computer operating system that it is running on. In the absence of that, I will generalize.
    Assuming that you are using
    Premiere Elements 12
    Add Media
    "DVD Camera or Computer Drive"
    Video Importer
    Typically the Video Importer Save In: is C:\Users\Owner\Videos
    Each of your DVD discs is going to have the same names for the ripped VOBs (VTS_01_1.VOB and so on depending on the duration of the movie). Consequently, after the ripping of the first DVD's VOBs and their save to Videos, you will end up with that "files already existing..." block for the ripping of the VOBs from the second DVD.
    The answer is, for each DVD disc VOB ripping, to plan ahead and create and set for different folders in Videos in the Save In field of the Video Importer.
    Please review and then let us know if that works for you. Please do not hesitate to ask if you need clarification on anything that I have written.
    Thank you.
    ATR.

  • How to capture a .gif file from a spectrum analyzer and save the file in PC

    I want to capture a .gif file from a spectrum analyzer and save the file in PC, but I've got a problem when read data from the instrument. I'm not sure how to format the string got from the instrument , When I use "%s" or "%t" as the read string format the data got from the instrument is truncated.
    my code are as follows, could anyone tell me where i am wrong?
    char resultsArray[5000];
    viPrintf(hSpectrumInstr, ":MMEMTORCR 'CICTURE.GIF'\n");
     viQueryf(hSpectrumInstr, ":MMEMATA? 'CICTURE.GIF'\n", "%t", resultsArray);
     printf("%s", resultsArray);
     getchar();       
    Solved!
    Go to Solution.
    Attachments:
    readResult.docx ‏50 KB

    char resultsArray[5000];
    viPrintf(hSpectrumInstr, ":MMEMTORCR 'CICTURE.GIF'\n");
    viQueryf(hSpectrumInstr, ":MMEMATA? 'CICTURE.GIF'\n", "%b", resultsArray);

Maybe you are looking for

  • Duplicate screen windows 8

    hi i cant seem to duplicate my screen im running a hp 500 series,vga to monitor and dvi adapter to hdmi going into my second screen which is a samsung tv smart tv,

  • Assignning Output type to Invoice/Po.

    Ho Folks, is there any userexit in the Invoice print/po print for assigning the exact form to an output? I have different forms for each country right now. I would prefer not to setup an output type (email) for every country unless I have to.  The be

  • Adobe DPS and Encryption

    Hi There, Just asking this question in advance. I know when you submit your app, you have to tick a box indicating if you app is encrypted or not. Having created my app entirely in indesign and Viewer Builder, is there any way that it could be encryp

  • Changing the functionality of mouseClicked via Toggle Buttons

    Hi, I want to be able to change the drawings produced by clicking the mouse by choosing what I want to draw from a series of toggle buttons on my GUI. I have an on my GUI, on top of a jPanel and when I click on it each click draws a red circle on the

  • What is the best size for using a graphic as my homepage?

    I am building my website in iWeb My graphic designer is going to send me a graphic that I want to use as my homepage graphic - I will input some text. He keeps asking me what size graphic I want (he charges by size) If this means file size is my answ