IIS ASP - Get Computer Name from Mapped Drives using Classic ASP

This is Interesting: Free IT Magazines  
Home > Archive > IIS ASP > March 2006 > Get Computer Name from Mapped Drives using Classic ASP





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Get Computer Name from Mapped Drives using Classic ASP
Ben

2006-03-21, 3:16 am

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

Patrice

2006-03-21, 8:03 am

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...
--
Patrice

"Ben" <bcumminsr@yahoo.com> a écrit dans le message de news:
1142872217.898855.52350@t31g2000cwb.googlegroups.com...
> 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
>



Ben

2006-03-21, 5:56 pm

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)

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com