views:

441

answers:

2

I'm attempting to read the contents of a file in a medium trust environment (Go Daddy), and Im naturally getting SecurityException with FileIOPermission. Is there anyway around this?

+3  A: 

Be careful to use relative paths for your site. When you do: c:\inetpub\wwwroot\dir\dir\dir\mysite to access a file. It starts to query from C and above. That type of access is disabled and you will get a SecurityException.

another solution is here: http://forums.asp.net/t/1052417.aspx

or here: http://stackoverflow.com/questions/271944/storing-temporary-user-files-in-asp-net-in-medium-trust

AdamSane
A: 

I allow users to upload file on my website BootBootReboot.com. You should be able to write to folders within your shared folder. Pretty much, use relative paths instead of static paths to random folders.

Just make sure that WRITE permissions are established for the folders to which you want to write the files.

Babak Naffas