When posting a blog entry or using HTML module I want to insert images. I browse to upload a file and after clicking upload get this:
We're sorry but a server error has occurred while trying to process your request. The error has been logged and will be reviewed by our staff as soon as possible. It is possible that the error was just a momentary hiccup and you may wish to use the back button and try again or go back to the home page
I am running under medium trust. I have set medium trust in web.config. I have allowed write access to \Data.
Here is error from log:
2010-04-19 09:01:04,940 ERROR mojoPortal.Web.Global - 148.168.40.4-en-US - /properties/Dialog/FileDialog.aspx?ed=fck&type=image
System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
at System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet)
at System.Security.CodeAccessPermission.Demand()
at System.IO.Path.GetTempPath()
at Brettle.Web.NeatUpload.FilesystemUploadStorageProvider.GetDefaultTempDirectory()
at Brettle.Web.NeatUpload.FilesystemUploadStorageProvider.GetTempDirectory(NameValueCollection attrs)
at Brettle.Web.NeatUpload.FilesystemUploadedFile.Initialize(FilesystemUploadStorageProvider provider, String controlUniqueID, String fileName, String contentType, UploadStorageConfig storageConfig)
at Brettle.Web.NeatUpload.FilesystemUploadedFile..ctor(FilesystemUploadStorageProvider provider, String controlUniqueID, String fileName, String contentType, UploadStorageConfig storageConfig)
at Brettle.Web.NeatUpload.FilesystemUploadStorageProvider.CreateUploadedFile(UploadContext context, String controlUniqueID, String fileName, String contentType, UploadStorageConfig storageConfig)
at Brettle.Web.NeatUpload.FilesystemUploadStorageProvider.CreateUploadedFile(UploadContext context, String controlUniqueID, String fileName, String contentType)
at Brettle.Web.NeatUpload.UploadStorage.CreateUploadedFile(UploadContext context, String controlUniqueID, String fileName, String contentType, UploadStorageConfig storageConfig)
at Brettle.Web.NeatUpload.UploadStorage.ConvertToUploadedFile(String controlUniqueID, HttpPostedFile file)
at Brettle.Web.NeatUpload.UploadModule.ConvertToUploadedFile(String controlUniqueID, HttpPostedFile file)
at Brettle.Web.NeatUpload.FileControl.InitializeFiles()
at Brettle.Web.NeatUpload.FileControl.get_Files()
at Brettle.Web.NeatUpload.FileControl.OnUnload(EventArgs e)
at System.Web.UI.Control.UnloadRecursive(Boolean dispose)
at System.Web.UI.Control.UnloadRecursive(Boolean dispose)
at System.Web.UI.Control.UnloadRecursive(Boolean dispose)
at System.Web.UI.Control.UnloadRecursive(Boolean dispose)
at System.Web.UI.Page.UnloadRecursive(Boolean dispose)
at System.Web.UI.Page.ProcessRequestCleanup()
at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest()
at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context)
at System.Web.UI.Page.ProcessRequest(HttpContext context)
at ASP.dialog_filedialog_aspx.ProcessRequest(HttpContext context)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
The action that failed was:
Demand
The type of the first permission that failed was:
System.Security.Permissions.EnvironmentPermission
The Zone of the assembly that failed was:
MyComputer