Get Computer Name from Mapped Drives using Classic ASP

B

Ben

Hi, Thanks for reading this post... I am trying to get the
computer/server names from the mapped drives on the Clients PC when
they select a file from the upload "browse" button. When the user
clicks on the "Browse" button on the "<input type="File"... control and
selects a file located in one of many possible mapped drives. I want
to save the location of the file as a path as you would see when
mapping a drive. For instance, "\\server\folders\... instead of the
mapped path of "P:\folder\subfolder\... etc. Therefore, when a user
views the document they can click on the link and get access to the
file regardless of how their drives are mapped. Oh, I need to be able
to do this from classic ASP.

I attempted to use the FileSystemObject object but cannot find the
method that gives me this information. I appreciate any help on this
item.

Thanks,
Ben
 
P

Patrice

Try the Drives collection. It looks like it provide a DriveType property
that allows to know if this is a network share and the ShareName property
should provide the location.

Now is this on controlled workstations ? You won't be able to do this client
side without changing the default security settings.

Not sure of the big picture. If files are uploaded it shouldn't be a
problem. If not you could also perhaps have some problems because of
security issues (have they all access to those files ?). If you know where
are those files (such as if you want to allow users to create "shortcuts" to
public files on an intranet site), you could perhaps provide your own UI ?

If you want further help, the big picture about what you are trying to do
may help to raise new suggestions from newsgroups readers...
 
B

Ben

Thanks for the response. The clients are all controlled on the same
domain but I can't guarantee that all drives are mapped the same.
Therefore, trying to eliminate the mapped drive letter and attempting
to use the computer name. Also, I am not uploading the file just
setting a location of the attached file required for a particular form
the user is viewing. The file access permissions will be handled with
a different group.

Tried the code below but no success (I know it is ugly but was just
trying many different things.)

Dim fso
dim fsoDrive
fsoDrive = window.ssli.File1.value
msgbox("Control Value: " & fsoDrive)

Set fso = CreateObject("Scripting.FileSystemObject")
'fsoName = fso.GetDriveName(fsoDrive)

dim PathAndFile
PathAndFile = fso.GetAbsolutePathName(fsoDrive)

msgbox("GetDriveName: " & fsoName)

msgbox("Get Abs Path: " & fso.GetAbsolutePathName(fsoDrive))

msgbox("Get Drive: " & fso.GetDrive(fso.GetAbsolutePathName(fsoDrive))

msgbox(fso.GetDrive(fso.GetAbsolutePathName(fsoDrive)))

Set d = fso.GetDrive(fsoName)

msgbox("volume name: " & d.VolumeName)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top