Access to the path is denied

6 posts, 0 answers
  1. Hans
    Hans avatar
    49 posts
    Member since:
    Jul 2010

    Posted 04 Sep 2013 Link to this post

    Hi

    In sharepoint 2010 I have a webpart with an AsyncUpload.

    If I upload a file  on a local folder everything is fine, If I try to upload on a shared folder on another server I get: "Access to the path is denied".

    The application pool user under the site is running has access to that folder as well as the domain user logged in to the sharepoint. I added even "everybody" with Read/Write permission on that shared folder and still the same error.

    The users are all Active Directory authenticated.
    I added all the AD users under the SharePoint is running and still the same error.

    Under what user .SaveAs(path) is running because for sure is not the same user as the one returned by "System.Security.Principal.WindowsIdentity.GetCurrent().Name"?

    Any thoughts what permission should I add to the shared folder ?

    Regards,
    Hans
  2. Plamen
    Admin
    Plamen avatar
    2729 posts

    Posted 09 Sep 2013 Link to this post

    Hello Hans,

     
    Thank you for contacting Telerik support.

    Basically the reason that is causing such error is most probably connected the rights of the Target and the temporary folders. That is why I will recommend you to add full rights control to the default temporary and target folder ("~App_Data/RadUploadTemp"), and assigned full control rights to the application pool account and the network service. Please try this with and without UseApplicationPoolImpersonation property and let us know if it helped. You can also try giving the IUSR full rights to the Upload directory.

    Hope this will help you solve the issue. If you have further questions please don't hesitate to contact us again.

    Regards,
    Plamen
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Sean
    Sean avatar
    19 posts
    Member since:
    Jun 2012

    Posted 25 Nov 2013 Link to this post

    I am having the same issue, but in my control I set the target folder to something other than default. But I am now getting the access denied error.

    Thoughts?

    Sean~
  5. Plamen
    Admin
    Plamen avatar
    2729 posts

    Posted 27 Nov 2013 Link to this post

    Hi Sean,

    Scenarios in which such error is observed are most probably connected with the rights of the folders where are saved the files. In such case I would also recommend you to make sure that the you have added full rights control to the folder you have set as TargetFolder.

    Regards,
    Plamen
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
  6. Hans
    Hans avatar
    49 posts
    Member since:
    Jul 2010

    Posted 27 Nov 2013 Link to this post

    If your control is in a SharePoint web part you need to run something like this:

    SPSite site = SPContext.Current.Site;

    SPWeb web = SPContext.Current.Web;

    SPSecurity.RunWithElevatedPrivileges(delegate()

    {

    using (SPSite ElevatedSite = new SPSite(site.ID))

    {

    using (SPWeb ElevatedWeb = ElevatedSite.OpenWeb(web.ID))

    {

    string path = Path.Combine(basePath, NewFileName);

    file.SaveAs(path);

    }

    }

    });

    Despite of what Telerik people said, I couldn't make it run without elevated privileges.And on the target folder , the user under the application run (application pool user) should have read/write permissions on that folder.

    Regards,
    Mihai

     

     

  7. Plamen
    Admin
    Plamen avatar
    2729 posts

    Posted 02 Dec 2013 Link to this post

    Hello,

    Thank you for sharing the code that worked in you case and for you concern with RadControls.

    Regards,
    Plamen
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017