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
5 Answers, 1 is accepted
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.
Plamen
Telerik
Thoughts?
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
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
Thank you for sharing the code that worked in you case and for you concern with RadControls.
Regards,
Plamen
Telerik