Reputation: 15511
I'm trying to open local file from Silverlight. I try Window.Navigate("c:\test.pdf", "_blank") and invoking JavaScript like this:
window.open("c:\test.pdf", "_blank")
Both give "Access is denied".
However it works in plain HTML when I do
<input type="button" value="test"
onclick="window.open('c:\test.pdf', '_blank')" />
Is it Silverlight security restriction? Can I open a local file in a browser from Silverlight application?
The reason behind this is that users store local paths and want to open those files from the app.
Upvotes: 0
Views: 1066
Reputation: 139
In Silverlight 4, you have access in the local file system, but to the user's "My" folders only. See http://timheuer.com/blog/archive/2009/11/18/whats-new-in-silverlight-4-complete-guide-new-features.aspx#localfiles
Upvotes: 0
Reputation: 29953
Silverlight is heavily sandboxed. As it is a web technology, you can probably imagine the potential security implications of giving it access to the file system.
Upvotes: 3