JTunney
JTunney

Reputation: 904

Uploading a file to a directory inside your application folder VS2013

While developing inside VS2013 using the built in IIS Express Web Server I created a Documents folder within my Application folder to upload files to. When trying to save a file I am using:

string uploadedFile = @"C:\dev\myApps\Application1\Documents\uploadedFile.pdf";
file.SaveAs(uploadedFile );

I added full control permissions to the Documents folder for IIS_IUSRS, NETWORK, NETWORK SERVICE. Still nothing.

Upvotes: 0

Views: 1526

Answers (1)

Dgan
Dgan

Reputation: 10285

Try this:

"Access to the path 'xxxxxx' is denied."

As error says you need to assign permissions to folders

  1. Right Click Folder
  2. Go to Security Tab
  3. Click on Edit
  4. Click on Add
  5. Click on Advanced
  6. Find Now
  7. Give Permission to IIS_IUSRS (Full Control)
  8. Click On OK
  9. Click On OK
  10. Click On Full Control in allow
  11. Click On OK
  12. Again Run the Application

Note: if the above steps are not working, then try to give same permission to NETWORK, NETWORK SERVICE users

Upvotes: 1

Related Questions