Programmatic File Upload

Discussion in 'Site Programming, Development and Design' started by james, May 10, 2010.

  1. I'm trying to use the "Silverlight Multi-file Uploader" code (http://slfileupload.codeplex.com), which uses an ashx to dynamically upload files, and I can't seem to get the code to work in the shared hosting environment.

    I have everything working locally...do we have to do some permission settings to allow directory creation from within out shared sandbox?

    Thanks,
    James
     
  2. Ray

    Ray

    What is your exact error message?
     
  3. So after firing up Fiddler, it looks like this is the actual exception:


    [SecurityException: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.]
    System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet) +0
    System.Security.CodeAccessPermission.Demand() +58
    System.IO.Directory.InternalCreateDirectory(String fullPath, String path, DirectorySecurity dirSecurity) +595
    System.IO.Directory.CreateDirectory(String path, DirectorySecurity directorySecurity) +150
    HttpUploadHandler.ProcessRequest(HttpContext context) +1112
    System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +181
    System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75
     
  4. When I'm trying to create a directory under the Uploads subfolder on my account it's erroring out...
     
  5. Ray

    Ray

    This is a trust level error. Set the trust level on your application to either Full or High.
     
  6. Gotcha...thanks Ray!
     

Share This Page