PDA

View Full Version : Access Local network drive with java


peggyk2
10-22-2002, 03:04 PM
I am using a menu javascript from Dynamic Drive. On one menu item I am trying to access a local network share. When I preview in Front Page it works fine, but when I try and access it in the browser (IE), it cannot display the page. This site is an internal intranet site. When accessing files on the local web server I have no problems.

The script I am using for the local web server that works is:
http://webserver/webaddress.htm

The script for the local share:
//server_name/share name/folder/file_name.htm

This does not work and I can't figure out why. Can anyone please advise?

beetle
10-22-2002, 03:29 PM
Is it using ActiveX to gain access? You man want to make sure that the FileSystemObject (Or whatever it's called) is using the correct absolute path to the share. You may even need to map that share to a drive letter for this to work....

peggyk2
10-22-2002, 04:22 PM
Thank you Beetle for your help. I don't think I am using DirectX and I have already tried using the drive letter. I guess I just don't understand why it works in Front Page preview but not in IE. The menu I am using is HVMenu. I know how to alter the script to get the look I want, but I have very few other javascript skills. I'm kind of at a loss on this one.

peggyk2
10-22-2002, 04:23 PM
Oops. I meant ActiveX.

Spookster
10-22-2002, 05:25 PM
When you preview the page via frontpage on your local system you most likely have a network drive path set up hence the reason you can view it. When the page is served through a web server the web server doesn't know where to access a network drive. If you want files to be displayed in your site then they should all be in a web accessible folder on the web server.

peggyk2
10-22-2002, 05:48 PM
Thank you all for your suggestions. The problem has been solved. It was a combination of several errors. When the menu was clicked on, it kept throwing an http: in front of the name even though it was not in the path. Once I got by that, it was a process of elimination to get the path to work. The backslashes and the forward slashed threw me, but it is working fine now.

The final solution was:

"J:\\foldername/foldername/filename"

Thanks again for your help.

Spookster
10-22-2002, 08:03 PM
You do realize though that if you do it that way then if someone else does not have that network drive set up with that specific drive letter then they will not be able to access those files that are not located on the webserver?

peggyk2
10-22-2002, 08:25 PM
Yes, I am aware of that. This is for a local intranet where everyone who accesses that drive is automatically mapped when they logon.

Spookster
10-22-2002, 09:46 PM
Originally posted by peggyk2
Yes, I am aware of that. This is for a local intranet where everyone who accesses that drive is automatically mapped when they logon.

Yes, but with that specific drive letter? Probably not. If they already have something else mapped with that drive letter then windows will use the next available one.