Request for the permission of type 'System.Security.Permissions.FileIOPermission error

Last post 08-30-2009, 10:07 PM by cutechat. 4 replies.
Sort Posts: Previous Next
  •  08-28-2009, 6:28 PM 55158

    Request for the permission of type 'System.Security.Permissions.FileIOPermission error

    I am getting the following error in both IE8 and FF3.

    Message: Sys.WebForms.PageRequestManagerServerErrorException: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
    Line: 604
    Char: 13
    Code: 0
    URI: http://..../ScriptResource.axd?d=mAdX6eEFtP0fcZYXhk1u4DJ_6j8HSI5PEx1ybgDGPhGk60gQGytztK9vHmWQfBxO-EEpbbiyvC_BTg5S0l0T1ukn5JQdidGmndkkfxAGJ_Z6GxeuSKntsZbYeeGW8Ss50&t=633406813064242674

    It is a .NET application using the version 2.0 of the AJAX Uploader. My web.config does have an  identity impersonate="true" userName="***" password="***"/>. The uploader has been working fine for months but recently (not sure when) it started failing. My web host has assured me that my user has permissions to write to the file system and that nothing changed on their side. While I do suspect otherwise I am a little confused becuase when uploading files they are able to write to my temp folder but when clikcing on the save button I get the error above.

    Any help would be greatly appreciated, my client is very angry.

  •  08-28-2009, 8:56 PM 55159 in reply to 55158

    Re: Request for the permission of type 'System.Security.Permissions.FileIOPermission error

    Hi,
     
    Please test this appSettings in web.config :
     
     <add key="CuteWebUI.AjaxUploader.AllowSession" value="True" />
     <add key="CuteWebUI.AjaxUploader.UseAspNetStream" value="True"/>
     
    (Please test True/True , True/False , False/True )
     
    It may helps for determining the reason.
     
    Regards,
    Terry
     
  •  08-29-2009, 9:04 AM 55169 in reply to 55159

    Re: Request for the permission of type 'System.Security.Permissions.FileIOPermission error

    I tried all three settings in my appSettings and the error was the same everytime.  Each time it appered the uploader was able to write file to the temp directory but then when clicking save I get the error.
     
    I commented out all the code in the save button hander and error did not occur. So then I started adding things back in to see when the error would occur. Checking if the page IsValid made it happen as well as trying to create a new directory to save the temp file in.
     
    Let me know if you have any other suggestions.
  •  08-29-2009, 9:30 AM 55170 in reply to 55169

    Re: Request for the permission of type 'System.Security.Permissions.FileIOPermission error

    Thanks for your suggestions but I confrimed its my web host who is not allowing my site access to create directories on the file system. It appears I can write files but not create/delete folders. When I use your the uploader in the most primitive form just putting a file in the temp directory and then moving it to an already existing folder then it works fine. It was the other file system manipulation I was doing that is causing the problem. It was my suspicion the whole time that it was my web host since nothing had changed from my side. Thanks again for your help.
     
    If you have any other suggestions I am all ears.
  •  08-30-2009, 10:07 PM 55177 in reply to 55170

    Re: Request for the permission of type 'System.Security.Permissions.FileIOPermission error

    Hi,
     
    If you do not want AjaxUploader create sub directories , you can try this way :
     
    <add key="CuteWebUI.AjaxUploader.TempDirectory" value="c:/windows/temp" />
     
    (find a good place to replace the c:/windows/temp)
     
    Regards,
    Terry
View as RSS news feed in XML