1

Using awesomium (or chromium), is it possible to load content from the file system?

Maybe by using ajax or some other method?

Paul Nikonowicz
  • 3,883
  • 21
  • 39

1 Answers1

1

Websites in Awesomium/Chromium, just like normal websites, operate in a sandbox. This means that without the user explicitly "giving" you a file, there is no way to access it.

However, your WPF application could easily read such a file and pass its contents to the web page using the awesomium control.

You use CallJavascriptFunction:

JSValue fileText = new JSValue(fileText);
webView.CallJavascriptFunction("someMethod", fileText );

Related (and where I got the base of that code from): calling Javascript from c# using awesomium

If you want to go the other way, see Can I call application methods from JavaScript in Awesomium?

Community
  • 1
  • 1
BradleyDotNET
  • 60,462
  • 10
  • 96
  • 117