Last post Jul 26, 2014 06:14 AM by XIII
Jul 25, 2014 01:43 AM|zermattbs|LINK
and all is fine.
To avoid users seeing my data files I have moved them (the files not the users!) into the ASP.NET folder, App_Data, and now get an error message when I use the form
"../App_Data/fileName.xml" . I get the following message when I execute:
"Failed to load data from App_Data/fileName.xml. Forbidden."
Jul 25, 2014 01:53 AM|XIII|LINK
you can't expose these files to the browser but server side you should be able to get to them like this:
string path = HttpContext.Server.MapPath("~/App_Data/filename.xml");
In the past you had to also add Current to that line like HttpContext.Current....
Jul 25, 2014 07:34 PM|zermattbs|LINK
FYI I had to add the "Current".
Or is there a better way?
Or have I completely misunderstood??
Jul 26, 2014 06:14 AM|XIII|LINK
if you want to expose files to the browser then it's a nogo to put them in the App_Data as it's protected to be downloaded from another source.
What you can do however is to make a Web API that reads out the xml file, from the App_Data, and sends out the needed information to the widget. I didn't work with the widget myself yet but I noticed some ajax part in it so you could call your Web API with
Update: been searching quickly in the documentation and there's a loadJSON function on the Timeline which you could likely use to call your Web API: