System.Security.Permissions.FileIOPermission exception even though trust level is full

cagin picture cagin · Jul 30, 2012 · Viewed 7.1k times · Source

I am trying to upload some pics to server. But when I try to upload, it throws this error:

System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

I checked this : WebPermission Exception even though I'm in Full trust

But I can't change IIS settings because my application is in a hosting company. I gave wite permissions to folder. And in my web.config file I have this code :

 <location allowOverride="true" path="ProductImages">
<system.web>
  <trust level="Full" originUrl=""  />
</system.web>

Do you have any suggestions for me?

Answer

Yasser Shaikh picture Yasser Shaikh · Jul 30, 2012

Give user WRITE permission to the folder where you are uploading to.