?
Solved

Mapped Drive Permission Issue

Posted on 2008-06-17
3
Medium Priority
?
980 Views
Last Modified: 2013-12-13
I have a PHP 5 script on a Windows 2003 server running IIS 6.0  The script puts a file on a mapped network drive.  When I log into the server as an administrator and run the script from the command line the file gets written to the mapped drive. When I run the script from a browser it errors out - "no such file or directory". I assume this is a permissions issue with the Internet Guest user trying to write the file as opposed to an administrator writing the file.  I've read some about this and I know one option is to write the file locally and then use a scheduled task to copy the file to the mapped drive.  However, I would rather not go through the extra step.  

I'm pretty new to IIS (I'm used to Apache running on Linux). In reading it seems there are ways to open up the permissions but that it might be a security risk.  Is there a way to give write permissions to a mapped drive without opening myself to a security issue?
0
Comment
Question by:trillian30
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 2

Assisted Solution

by:grahammj
grahammj earned 1000 total points
ID: 21807899
Have you tried it with the UNC path name?  For example \\server\share\directorypath?

The issue is when you are not logged on, the a mapped drive doesn't exist.  Meaning scripts should be hard coded to use the UNC name.  See what error it gives you after that.

-mjg
0
 

Author Comment

by:trillian30
ID: 21814361
The administrator is left as logged in to keep the mapped drive available.  

 When I use the UNC I get the following error: "[function.fopen]: failed to open stream: Invalid argument". Sample of my code (php)    $file = fopen ('\\\myserver\\myshare\\mypath\\test.test','w');

I'm a little confused about permissions when using the UNC.  Our mapped drive has an associated user/password for authentication against the share on the server we are connecting to.  Because we leave the adminstrator logged in, scripts that reference the mapped drive and run from a scheduled task work because the map drive still exists.  If I use UNC in my script  how do I pass the user/password to authenticate against the other sever to get to the shared area?

0
 

Accepted Solution

by:
trillian30 earned 0 total points
ID: 21963913
I couldn't find a way to have secure access to the mapped drive on the web server and still allow the files to be written to the mapped drive by the anonymous IIS user, so the files are written to a directory on the web server and then a script runs every 10 minutes to pick the files up and move them to the mapped drive.  Not the most elegant solution, but it works.
0

Featured Post

Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses how to create an extensible mechanism for linked drop downs.
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to count occurrences of each item in an array.
Suggested Courses

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question