Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

Asp.net 4 FileUpload gets "Permission Denied" when Uploading file

Avatar of JS List
JS ListFlag for United States of America asked on
Microsoft IIS Web ServerASP.NET
8 Comments1 Solution692 ViewsLast Modified:

There's 2 apps that upload files.  Both have been running fine.  Files were able to be uploaded.  I uploaded a file through it 3 days ago and it worked.  This morning it comes up with an error: "Access to the path 'D:\.....' is denied."

It's happening write at this code line
      FileUpload1.SaveAs(thisSaveServer + savePath)
I looked at the code for thisSaveServer and savePath and it looks good - hasn't changed

Here's the weird thing.  There's 1 IIS server and 4 webs on it.  2 Webs for testing (A & B)  2 webs for production (C & D)
In each case Web B uploads to Web A and Web D uploads to Web C.  A Virtual Directory is used in each case.
Production (Web D->C) works great
Testing Web(B->A) gives me an error.

I copied the .aspx file from Production to Testing and got the same error.  So it's not the code.

I look at the permissions and they are identical.   IIS_MACHINENAME  has full control
For the application pools identity they are using ApplicationPoolIdentity

Here's something new: I was able to upload 1 file and not the other.  These are all pdfs.  When I opened the pdf files on the server -  go to properties -> Details -> The one that wouldn't upload says Owner = Administrators.  The one that did upload says Owner = App Pool Identity name.

When I open the pdfs on my desktop that were uploaded they both have me as the owner.

Any ideas on where I could investigate and find what's happening?  Talked to the server guys and they said they didn't change anything.

Avatar of Dan McFadden
Dan McFaddenFlag of Germany imageTechnical Lead - Active Directory

Our community of experts have been thoroughly vetted for their expertise and industry experience.

This problem has been solved!
Unlock 1 Answer and 8 Comments.
See Answers