twiss
Posts: 1
Joined: Thu Jan 14, 2016 5:23 pm

Webbrowser local files

Thu Jan 14, 2016 5:33 pm

I am running in a problem, I need to access a local hosted index.html.

I have a running web app, an call th website with: DoWebNavigate("http://www.twiss.eu");

This is working fine.

I have uploaded a custom index.html to c$\local_site\
But I can not figure out how to call this file instead of "http:\\www.twiss.eu"

Already tried:
DoWebNavigate("file///c$/local_site/index.html")
DoWebNavigate("file///c/local_site/index.html")
DoWebNavigate("file///C/local_site/index.html")

Help....

stderr
Posts: 2178
Joined: Sat Dec 01, 2012 11:29 pm

Re: Webbrowser local files

Thu Jan 14, 2016 7:21 pm

twiss wrote:I am running in a problem, I need to access a local hosted index.html.

I have a running web app, an call th website with: DoWebNavigate("http://www.twiss.eu");

This is working fine.

I have uploaded a custom index.html to c$\local_site\
But I can not figure out how to call this file instead of "http:\\www.twiss.eu"

Already tried:
DoWebNavigate("file///c$/local_site/index.html")
DoWebNavigate("file///c/local_site/index.html")
DoWebNavigate("file///C/local_site/index.html")
I'm not sure what you are using to do this but various ways to operate on web pages do not have support for accessing the local file system. This can mean that you can't very easily test without setting up a local web server or writing some sort of layer between two different means of access, one for the web and the other for the local file system.

If you type

python -m SimpleHTTPServer 8000

in the directory with the file you want to load in, you should be able to access it with your web based library with something like

DoWebNavigate("http://localhost:8000/index.html");

Replace localhost with the actual ip if are using a different machine to serve up the web page.

If you need to access files and web pages transparently, you might have to glue together two different libraries or perhaps find something that handles this transparently.

ricl
Posts: 657
Joined: Wed Aug 26, 2015 11:55 am

Re: Webbrowser local files

Thu Jan 14, 2016 8:36 pm

Windows 10 Core IoT?
ricl : F/gamma = ma : Law ii(a) : https://climatedatablog.wordpress.com/2016/01/02/an-energy-challenge-2016/ #AnEnergyChallenge2016

luc_winters
Posts: 2
Joined: Tue Jan 19, 2016 3:50 pm

Re: Webbrowser local files

Sun Jan 24, 2016 12:52 pm

Hi,

I am struggeling with the same, I want to load a index.html from connected usb device.
if you make any progress, please post. (I will if I find a way)

reg.
Luc

luc_winters
Posts: 2
Joined: Tue Jan 19, 2016 3:50 pm

Re: Webbrowser local files

Sat Jan 30, 2016 3:03 pm

Still not found a solution, anyone has any idea?

configuration:
raspberry pi, windows 10 IOT
simple iot webbrowser to load page.

Internetpage is loading oke, but I seem to have no access to local usb device.
I think I should load it like: DoWebNavigate("file///e$/index.html")
but this is not working.

ricl
Posts: 657
Joined: Wed Aug 26, 2015 11:55 am

Re: Webbrowser local files

Sat Jan 30, 2016 3:10 pm

Any UWP application can only access files in its own local storage tree (and the well know libraries for shared files). To go beyond that will require writing in Win32. The rest is not accessible from UWP.

19. Open a file in C# for access to read/write it

// create a file with the given filename in the local folder; replace any existing file with the same name
StorageFile file = await Windows.Storage.ApplicationData.Current.LocalFolder.CreateFileAsync(filename, CreationCollisionOption.ReplaceExisting);

20. Why can't I open c:\something.txt

UWP applications can only use the Well Known Folders for storage, no access is allowed to the wider core file system
...


For the E; drive the Known Folder is 'RemovableDevices'

Possibly confusingly, you need Removable Storage permissions in the manifest.
ricl : F/gamma = ma : Law ii(a) : https://climatedatablog.wordpress.com/2016/01/02/an-energy-challenge-2016/ #AnEnergyChallenge2016

Return to “Windows 10 for IoT”