Sign in to follow this  

Problem with local files using "file" protocol for setDataURL

Recommended Posts

We are trying to link up files that live on mounted volumes.


The volumes are visible on the webserver. This is an internal server so we have no concern for security.




I am unable to get the graph to work if its pointing to the path on the volume.


I am, however, able to view XML the file no problem with the same command.




It looks like FusionCharts is using the WEB root path and not the file:/// path that I am giving it.




Do I need to format the string slightly different when passing a file:/// to the javascript function?




Here is what something like what I am trying to do.




function draw_chart(query,debug)


var chart1 = new FusionCharts("/charts/MSLine.swf", "RTDynamicChart", "700", "600", debug, "0");

query = "/data/FusionCharts/SampleFile.xml";


chart1.setDataURL( escape( query) );

//chart1.setDataURL( escape( "file://" + query) );

if(debug) {

document.write("View XML");




Share this post

Link to post
Share on other sites

Well, solved my own problem:




For python folks:




def printXML(file):

    fhand = open( file , 'r')

    print "".join(fhand.readlines())





Worked for me!!!

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this