Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Getting rid of an unwanted URL

Posted on 2012-04-03
5
Medium Priority
?
294 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 84

Accepted Solution

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

Author Comment

by:GCU
ID: 37803745
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
ID: 37806165
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
ID: 37806307
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
ID: 37806575
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Aerodynamic noise is the cause of the majority of the noise produced by helicopters. The inordinate amount of noise helicopters produce is a major problem in the both a military and civilian setting. To remedy this problem the use of an aerogel coat…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…

916 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