【发布时间】:2012-07-30 07:43:03
【问题描述】:
我正在尝试将一些图片上传到服务器。但是当我尝试上传时,它会抛出这个错误:
System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
我检查了这个:WebPermission Exception even though I'm in Full trust
但我无法更改 IIS 设置,因为我的应用程序位于托管公司。我给了文件夹的白权限。在我的 web.config 文件中,我有以下代码:
<location allowOverride="true" path="ProductImages">
<system.web>
<trust level="Full" originUrl="" />
</system.web>
你对我有什么建议吗?
【问题讨论】:
-
我与我的托管公司联系。他们告诉我,我的项目在中间信任服务器中。他们说,如果你想解决这个问题,我们应该将你的项目移动到完全信任服务器。我告诉他们,我以前可以将图像上传到服务器,但现在我不能,但他们找不到任何其他解决方案。当我解决我的问题时,我会在这里创建一个答案。非常感谢您的建议。
标签: asp.net c#-4.0 file-upload full-trust