Wednesday, March 21, 2012

Permissions for website on localhost

I have a site "http://localhost/mysite" which has a page containing a window
s
user control which displays a list of all files in a folder on the client
machine.
When I run the webapp I obviously get an error message saying that the .net
framework wont allow permissions to do such a thing.
Can anyone tell me how I can set permissions on my machine so that I can run
this ?Have you defined the permissions in the IIS website properties?
Thats not the problem.
Its the client. I must set up the .net framework to accept any actions
coming from this URL. It must allow my dll to perform whatever it wants on
the client machine.
It just so happens that its on localhost at the moment.
Start here:
http://msdn.microsoft.com/library/d...esssecurity.asp
I have gone in to the .net configuration manager and set the URL as trusted
but still no joy.
To be honest, I'm not sure if this is even possible--at least, without
extensive work.
ASP.NET code executes on the server, and as such, that is all it has
access to.
In addition, JavaScript is restricted from accessing the file system,
so that rules that out.
The only way I could imagine being able to access the client's file
system is to create an ActiveX control that the clients would have to
download and install, and that code would have to be trusted on the
client machine.
You may be better off to re-evaluate the architecture of your
application--does it really need this functionality? If the answer is
yes, you should probably look into developing a windows forms/smart
client.
What exactly are you trying to do, anyway? Why would a user go to your
website to navigate the files on his local machine?

0 comments:

Post a Comment