in reply to Windows Share Access from CGI Script

As previously mentioned, the most likely cause is that your CGI code is running under default security, which is "Anonymous" access.

You need to either (a)disable anonymous access on the page or directory, from the IIS control (mmc). or
(b)change the user ID inside the script, which can get very complicated.
I recommend (a).

The other thing is that you are using unix-style forward-slashes for the file name. This is usually OK, but for Window's sanity sake, I would suggest:

$file = "\\\\my_machine\\share\\file1.txt";
The alternative is to use single-quotes (or q()), so you don't have to escape the back-slash.

Replies are listed 'Best First'.
Re: Re: Windows Share Access from CGI Script
by qadwjoh (Scribe) on Sep 30, 2003 at 09:07 UTC
    Personally, I prefer the UNIX style and with the application I'm developing being a cross-platform one, I prefer to stick with just the one style. It doesn't make any difference to ActivePerl.