Python cgi script can't copy to or modify items on file server

I'm working on an application to be used on our intranet.  It needs to be able to create directories and move files to our file server (N:), and to eventually modify them.  Currently, I'm testing it using IIS (localhost) on my computer.  I'm a novice at IIS by the way.   Okay, I'm using a python cgi script and it is unable to do this...
driveLetter = r'N:'
    picDir = os.path.join(driveLetter,r'FieldPics') #set output directory as N:\FieldPics   
    
    picCountyDir = os.path.join(picDir, str(county[0])) #set output directory as N:\FieldPics\CountyName 
    if not os.path.exists(picCountyDir):
        os.makedirs(picCountyDir) #if necesssary create the county directory inside the N:\FieldPics directory

Open in new window


It tells me, "The system cannot find the path specified."   I have given IUSR and NETWORK SERVICE full control of N:\FieldPics.  I'm unable to figure out what I need to do next.
Nate_LRAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

clockwatcherCommented:
FIrst off, you'll need to use the UNC path rather than a mapped drive.  Mapped drives are based on the security context of the running process and your IIS process won't have an N:\ drive.  
sharePath = r'\\MyServer\myShare'
picDir = os.path.join(sharePath, r'FieldPrice')

Open in new window

If you're allowing anonymous access, your next problem will be a problem with IIS impersonation.  See the microsoft kb article (http://support.microsoft.com/kb/207671) for details.  But basically, you'll need to get IIS to use a network account to access the resource by setting the application pool identity to a domain account:

1) Right-click the Application Pool hosting your CGI process (unless you've made changes it will be the DefaultAppPool)
2) Select Advanced Settings...
3) Update the Identity setting -- switch it to custom and enter the username (domain\username) and password of an account that IIS will use to access the resource
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Nate_LRAuthor Commented:
I REALLY appreciate this clockwatcher!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft IIS Web Server

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.