Help - Writing Web Control to Access the Local FileSystem

  • Thread starter Thread starter Nigel
  • Start date Start date
N

Nigel

Hi,

We have a need to write a web control that access the local filesystem
and creates a set of hyperlinks based on the files contained within a
directory (this will then be used in a sharepoint web part).

Don't know a lot about this stuff, but have written an ActiveX control
that, when used on a Windows form, works correctly, however when used
on a web application gives the following error:

Request for the permission of type
'System.Security.Permissions.FileIOPermission, mscorlib,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=xxxxxxxxxx' failed.

Can anyone explain what is happening here, and how I resolve this
issue?

Not knowing alot about this, I am not sure if this approach is the best
one. If anyone has ideas about other (better) ways that we could
achieve this, please let me know.

Many Thanks,

Nigel
 
welcome to the sandbox.

I'm not a web-OCX guru, but I suggest that this could cause huge
security issues, allowing (depending on the features exposed) random
pages (e.g. intranet?) to exploit your control to browse any user's
file system. I suggest you take a look at:
http://msdn.microsoft.com/msdnmag/issues/02/06/rich/ (search for the
phrase "File system access is the big one").

There may be some solutions involving signing the code with a a valid
(chained) certificate and assigning the required permissions (not
ideal, as not very site-specific), or possibly trusting the site
(worse) - or maybe some caspol hacks...

No simple answer for you, though

Marc
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top