Reputation: 2026
Currently I am getting this error when trying to copy a local file over to a shared network drive.
Access to the path '\\vlanxxxx\Vlanxxx\VT\12345.pdf' is denied'
Background Information
IIS->Application Pools
my Application has the correct permission to access the shared driveC:\log\12345.pdf -> C:\test\12345.pdf
Purpose: My overall purpose is to copy a file in my local server to a shared mapped network drive.
Q: Is this actually possible when using ASP.NET, is there any networked shared drive limitations when using this technology?
Code for copying the file over (I am pretty sure the code is fine, but here is the code incase)
String path = @"C:\log\12345.pdf";
String dest_path = @"\\vlanxxxx\Vlanxxx\VT\12345.pdf";
File.Copy(path, Path.Combine(dest_path, Path.GetFileName(path)));
Thank you for the help and assistance, I appreciate your time! Please let me know if there is any misunderstanding in the question. I will try to edit and clarify as soon as possible.
Upvotes: 2
Views: 2994
Reputation: 486
In IIS, try to give write permission to the users IUSR
and IIS_IUSR
in that destination path / folder.
Upvotes: 2