Pergunta

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?

Foi útil?

Solução

If its your private/dedicate hosting server then set write permission on the folder where you are want to upload images. In shared hosting you are not allowed to write to all folders hence you need to set write permissions on a specific directory, mostly we need to ask hosting provider to enable write permissions otherwise the exception is obvious

Outras dicas

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

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top