Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Mapped Drive Permission Issue

Posted on 2008-06-17
3
Medium Priority
?
981 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

Fill in the form and get your FREE NFR key NOW!

Veeam® is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

Question has a verified solution.

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

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses

610 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