AustinT
AustinT

Reputation: 2026

ASP.NET MVC3 Copy file to Shared Mapped Drive - Access to the path is denied

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



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

Answers (1)

Max Becerra
Max Becerra

Reputation: 486

In IIS, try to give write permission to the users IUSR and IIS_IUSR in that destination path / folder.

Upvotes: 2

Related Questions