This is a migrated thread and some comments may be shown as answers.

Radupload "Access to the path *** is denied. Permission issue

4 Answers 782 Views
Upload (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Shinee
Top achievements
Rank 1
Shinee asked on 03 Oct 2011, 11:47 AM
Hello there.
I am using RadUpload and It is working correctly now, but occuring this error when I clicking on UPLOAD button in rad image manager or rad document manager.
What should I do?
To make my issue clearly:

I am going to upload my file to Dir1/Dir2/uploadingimage.gif
I have dir1 directory.
I will create dir2 directory from my C# code behind.
I am selecting uploadingimage.gif and click upload button.
Then I am having this error.

Server Error in '/' Application.

Access to the path 'C:\inetpub\wwwroot\Test2\News\File\images\001\pu001021020\bgr.png' is denied.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.UnauthorizedAccessException: Access to the path 'C:\inetpub\wwwroot\Test2\News\File\images\DIR1\
DIR2
\bgr.png' is denied.

ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity. ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or Network Service on IIS 6) that is used if the application is not impersonating. If the application is impersonating via <identity impersonate="true"/>, the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user.

To grant ASP.NET access to a file, right-click the file in Explorer, choose "Properties" and select the Security tab. Click "Add" to add the appropriate user or group. Highlight the ASP.NET account, and check the boxes for the desired access.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[UnauthorizedAccessException: Access to the path 'C:\inetpub\wwwroot\Test2\News\File\images\DIR1\DIR2\bgr.png' is denied.]
   System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) +10546931
   System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy) +2580
   System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy) +138
   System.IO.FileStream..ctor(String path, FileMode mode) +91
   System.Web.HttpPostedFile.SaveAs(String filename) +151
   Telerik.Web.UI.PostedFile.SaveAs(String fileName, Boolean overwrite) +54
   Telerik.Web.UI.Widgets.FileSystemContentProvider.StoreFile(UploadedFile file, String path, String name, String[] arguments) +120
   Telerik.Web.UI.RadFileExplorer.ProcessUploadedFiles() +959
   Telerik.Web.UI.RadFileExplorer.OnLoad(EventArgs e) +169
   System.Web.UI.Control.LoadRecursive() +66
   System.Web.UI.Control.LoadRecursive() +191
   System.Web.UI.Control.LoadRecursive() +191
   System.Web.UI.Control.LoadRecursive() +191
   System.Web.UI.Control.LoadRecursive() +191
   System.Web.UI.Control.LoadRecursive() +191
   System.Web.UI.Control.LoadRecursive() +191
   System.Web.UI.Control.LoadRecursive() +191
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2428


Version Information: Microsoft .NET Framework Version:2.0.50727.4927; ASP.NET Version:2.0.50727.4927

4 Answers, 1 is accepted

Sort by
0
Kevin
Top achievements
Rank 2
answered on 03 Oct 2011, 01:23 PM
Hello Shinekhuu,

Do you have Write permissions allowed on the folder you're trying to upload the files to? That appears to be the reason why you get this error.
0
Shinee
Top achievements
Rank 1
answered on 03 Oct 2011, 01:30 PM
Hi, thanks Kevin.
I though this is not causing from Dir2's permission
because error message is

Access to the path 'C:\inetpub\wwwroot\Test2\News\File\images\DIR1\DIR2\bgr.png' is denied.


Why bgr.png (it's the file name which I have just tried to upload) is denied? Isn't it should be :

Access to the path 'C:\inetpub\wwwroot\Test2\News\File\images\DIR1\DIR2' is denied.

if it's causing because of dir2's permission?
Thanks
PS: I gave 777 permission to dir1, dir 2 and containing folders
0
Shinee
Top achievements
Rank 1
answered on 04 Oct 2011, 03:30 AM
SOLVED
IIS--> appool --> Advanced settings --> LocalSystems OK :D
0
Waseem
Top achievements
Rank 1
answered on 20 Oct 2012, 12:03 AM
Hi I am trying to upload File by using RadUpload. Its work on local pc as well as on Server. But on our one client pc (Window 7). it cause error. I am 100 % sure about my code. Its working great. Is there any permission or what is this?

Could not find a part of the path 'D:\Testing\Test.pdf'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.IO.DirectoryNotFoundException: Could not find a part of the path 'D:\Testing\Test.pdf'.

[DirectoryNotFoundException: Could not find a part of the path 'D:\Testing\Test.pdf'.]
   System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) +216
   System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath) +2481
   System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy) +229
Tags
Upload (Obsolete)
Asked by
Shinee
Top achievements
Rank 1
Answers by
Kevin
Top achievements
Rank 2
Shinee
Top achievements
Rank 1
Waseem
Top achievements
Rank 1
Share this question
or