For any remote drive on the server, I cannot use GetFolder(). For example,
if I do the following:
set fs = Server.CreateObject("Scripting.FileSystemObject")
set folder = fs.GetFolder("F:")
I get the following errror:
Server object error 'ASP 0177 : 800a004c'
Server.CreateObject Failed
/default.asp, line 1
The operation completed successfully.
As another example, if I do the following:
set fs = Server.CreateObject("Scripting.FileSystemObject")
set drive = fs.GetDrive("F:")
response.write drive.isReady
I get the following:
False
Why? "F:" is not a floppy drive or a cd-rom drive. It is a hard drive on a
remote server. I can access it no problem from windows nt explorer. The
above failures occur for any networked drive I try.
John
The second problem is a security problem. ASP runs in a security context
which forbids access to network drives. You need to change your security
settings on the server to allow access to these drives. (No, I don't know
how -- I write compilers for a living, I have no idea how web server
security administration works!)
Eric
John Roets <jro...@auragen.com> wrote in message
news:uxclC$nX#GA....@uppssnewspub05.moswest.msn.net...
As you said, though -- and after reading some more myself -- it does seem to
be a security issue.
If someone could outline exactly what needs to be done to get this to work,
I would greatly appreciate it. Or perhaps someone can point me to an
already-written server-side component that can do this for me.
John
Eric Lippert (Microsoft Scripting Dev) wrote in message ...
If you use NTLM Authentication, you are limited to true drive letters on the
server. If you use Basic Authentication, you can use UNC names referencing
a share on the same or another server. From a security point of view, as
soon as you use UNC, it looks like a machine hop and for that you need user
credentials to respond to the challenge/response. NTLM doesn't give IIS the
credentails (username/password) needed to respond. Of course the server's
file system ACLs have to allow the user the appropriate level of access you
need them to have.
--
=======================
|| Mike Harris
|| mailto:mik...@safeco.com
=======================
John Roets wrote in message ...
004c (hex) = 76 decimal...
76 = Path not found
If "F:" is a mapped network drive letter pointing to a network share, then
"F:" won't mean anything except to a locally logged on interactive user who
maps "F:" to something...
--
=======================
|| Mike Harris
|| mailto:mik...@safeco.com
=======================
John Roets wrote in message ...
Dave
>>>Begin quote:
In answering another question in the public newsgroups, I stumbled across
how you can use UNC's in an FSO operation, e.g.,
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.OpenTextFile("\\192.168.1.253\cdrive\boot.bak",1)
Response.Write f.ReadAll
f.Close
Set f = Nothing
Set fso = Nothing
To do this, the page must run under an account that is defined on both the
web server and the remote machine. So the first step is to create a user
account on both systems with the same password. (You can't use the default
IUSR_machinename unless you set the password manually -- I haven't tried
this.)
Set up the page or directory or whole site to use that user account. In
MMC:
1. Right-click the virtual server, directory, or file in question.
2. Select Properties.
3. Select Directory Security (File Security for a single file).
4. Select "Edit" in "Anonymous Access and Authentication Control".
5. Select "Allow Anonymous Access" to enable the "Edit" control.
6. Select "Edit".
7. Clear the "Enable Automatic Password Synchronization" option.
8. Enter the account and password that's valid on both machines.
Security is an issue, of course, so make sure the user account doesn't have
any more privileges than necessary.
But it works. This would be a good addition to a FAQ somewhere.
Ken
004c = 76 decimal
Error 76 = Path not found
> set folder = fs.GetFolder("F:")
If "F:" is drive letter mapped to a network share, it won't be seen even by
an authenticated user. It's my understanding that mapped drives are visible
only to the logged on interactive user who mapped the drive.
I found some useful articles at Microsoft's site:
http://support.microsoft.com/support/kb/articles/q197/9/64.asp, entitled
"PRB: Cannot Access Remote Files with the FileSystemObject."
http://support.microsoft.com/support/kb/articles/Q184/5/66.ap, entitled
"HOWTO: Set Up Duplicate Anonymous Accout on Separate Server".
Finally, http://msdn.microsoft.com/library/techart/msdn_authentication.htm,
entitled "Authentication and Security for Internet Developers".
Thanks to all for the help.
John
David E. Stockbridge wrote in message ...
Regards,
Frank