locked
How to load a local html file that is not included in the application’s package

    Question

  • How to load a local html file that is not included in the application’s package? for example, i want to use iframe to load a file located on the applicationData.localFolder.
    Thursday, January 5, 2012 3:10 PM

Answers

  • Unfortunately loading script from appdata folders is not a supported scenario for security reasons (e.g. script potentially scouring app data for personal information). You can load through the file picker, but that of course requires user interaction.
    Thursday, January 5, 2012 9:21 PM
  • You could try prepending file:// to the path then setting the src attribute of the iframe with that URL. Haven't tried this, so I don't know if it'll work.
    Friday, January 13, 2012 9:23 PM

All replies

  • Hello.

    How about using the file picker to let the user choose the file you want to load?


    Luis Abreu
    Thursday, January 5, 2012 3:27 PM
  • Unfortunately loading script from appdata folders is not a supported scenario for security reasons (e.g. script potentially scouring app data for personal information). You can load through the file picker, but that of course requires user interaction.
    Thursday, January 5, 2012 9:21 PM
  • Hi Kraig,

    If i use the file picker to load a html file,  how to display/navigate to that file in an iframe of the app page?

    -Joe 

    Wednesday, January 11, 2012 9:25 AM
  • You could try prepending file:// to the path then setting the src attribute of the iframe with that URL. Haven't tried this, so I don't know if it'll work.
    Friday, January 13, 2012 9:23 PM
  • We want to load some HTML, CSS and JavaScript content from different sources using this method. We retrive from a remote server all the content and store it on a folder from Windows 8. After that we load inline all the HTML, CSS and JS code.

    We tried already on a POC and it seems to work fine. I would like to know if we could have some problemes when we will submit the application to the marketplace, or  if you see any kind of problems that could appear.

    Friday, July 20, 2012 7:44 AM
  • Hi Radu, i have the same problem.

    What's POC ?How you make it work fine?

    Give me some help please, 3Q

    Wednesday, August 15, 2012 7:28 AM
  • Jeff, I think he means Proof-Of-Concept.
    Wednesday, April 10, 2013 9:13 PM
  • This would violate the Store Cert Requirements 3.9. So you are out of luck :( Would be nice to be able to load signed files from remote sources though and run them in local context with the users consent. Just like "This app would like to use your cam" the WinRT could ask for permission "This app would like to download additional content from the Internet".
    Thursday, April 11, 2013 4:26 PM