Solved

Getting rid of an unwanted URL

Posted on 2012-04-03
5
218 Views
Last Modified: 2012-10-04
I have seen some posts on here close to this topic but nothing that has resolved my issue thus far.
I have a simple flex app that is pretty much a data grid that is populated by a list of xml files that is given by a php file on the server. Using firebug I have tracked the issue down to one location and that is where flash is trying to load the xml url to be parsed into the data grid.
The thing works on our QA but when it is in prod it it has issues. Part of the issue is that the location where the xml files need to be read are not web accessable meaning you can't type a url in a browser to view it, whereas on the qa you can, either way I made the URLs relative but it's still adding a domain to the front of it, example:

flash is fed this url to look for the xml file "../../../placemenxml/someFile.xml"
yet firebug is showing that flash is looking for "http://our.servername.com/placementxml/someFile.xml"

so where is the stupid "http://our.servername.com/" coming from?
I've tried adding <param name="base" value="."/> in the html page and that changes nothing for QA, the QA still has it's servername appended to the front as well.

fire bug says this as a response: "The requested URL /placementxml/someFile.xml was not found on this server", does this mean the relative "../../../" is not being applied? how can I make this work?
0
Comment
Question by:GCU
  • 2
  • 2
5 Comments
 
LVL 82

Accepted Solution

by:
Dave Baldwin earned 400 total points
Comment Utility
If "../../../" is trying to go up past the web root, it probably won't work on the web.
0
 

Author Comment

by:GCU
Comment Utility
yeah, the web root is still 2 or so dirs above where the xml files are and the swf is 3 below that, so I don't think that's the issue.
0
 
LVL 11

Expert Comment

by:petiex
Comment Utility
If the xml is not web-accessible, you can't access it from a web-deployed swf. It's a security feature. I'm guessing your QA compiles the code for a local sandbox (local-with-filesystem) so that it can access the local filesystem. That cannot work when it is deployed to the web.

If you want to embed xml files into your application, it turns out you can. http://dispatchevent.org/roger/embed-almost-anything-in-your-swf/

In the comments of that post, they seem to suggest that you need to specify a mime-type of octet stream, rather than text/xml, like this:

[Embed(source="someFile.xml", mimeType="application/octet-stream")]
private const myXML:Class;

var x:XML = XML(new myXML());
trace(x.toXMLString());
0
 

Author Comment

by:GCU
Comment Utility
If the xml is not web-accessible, you can't access it from a web-deployed swf.

I had a feeling that might be the case, seems as if I might need to find a work around.
I can't embed the xml files since they are generated by another swf (they are exam results)
I'm thinking I might have to have php read the xml and send the data back to flash, stupid but seems like the only way right now.
0
 
LVL 11

Expert Comment

by:petiex
Comment Utility
I wouldn't flat-out call the security features stupid, but they certainly can be frustrating. Just remember there's nothing more frustrating than someone exploiting a vulnerability in your app to destroy or steal important data :)

I think it makes a lot more sense to expose xml files using a service, rather than putting them in a web-accessible directory, so yeah, I think you should go with that. For one thing, assuming that users may have expectations of confidentiality concerning exam results, you would be able to add some kind of password protection to the php service you use to expose those xml files.
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

First things first - Preparation We need all the part for this install and it's much nicer to have them all on hand when you need them so here's what's required. Download Eclipse 3.5 32 bit (I like the Classic flavour) from here. (http://www.e…
In this step by step tutorial with screenshots, we will show you HOW TO: Enable SSH Remote Access on a VMware vSphere Hypervisor 6.5 (ESXi 6.5). This is important if you need to enable SSH remote access for additional troubleshooting of the ESXi hos…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now