The moose likes Servlets and the fly likes linking to url's local to client machine Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "linking to url Watch "linking to url New topic

linking to url's local to client machine

Sam Walker
Ranch Hand

Joined: Nov 06, 2002
Posts: 65
First, I'm sorry if this question may not be directly related to this forum, any suggestions for more appropriate web sites will be appreciated.
Is there a way to have a web application find and open a file on the client�s machine? I would like to be able to create a link that will open a file, html or image, from a pre-defined directory local to the client machine. This is somewhat similar to mp3 server pool programs that allow on line users access each other�s �My Music� directory and download files.
I know many issues are involved including application/web server being used. I may even need to use ActiveX components. But I�m not sure about any of this and I�m asking the question here because this forum has the best pool of Java experts.
Any advice is appreciated? Thanks in advance.
Frank Carver

Joined: Jan 07, 1999
Posts: 6920
If you know the volume and directory structure of the client machine, you can send a response from the server which will request the browser to open a "file://" URL, and show the contents of the local resource to the user. But your web application won't be involved in that process andy more, and no local information will be transferred from the client to the server.
Is that what you are looking for?

Read about me at ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
Sam Walker
Ranch Hand

Joined: Nov 06, 2002
Posts: 65
Hi Frank,
This does sound like what I�m (was) looking for, but after your hint I realized that I hadn�t thought things through and in practical terms.
I was thinking that through a registration process a user would give me the name of a directory where the html or image files could be found. Then all I had to do was to take the user there through a link on the page. But this wont work under all circumstance. What will happen if the user comes to my page using a computer different from the computer that has the registered directory on it? I guess I will just give up on this idea.
Thanks a lot your hint helped me think this through.
I agree. Here's the link:
subject: linking to url's local to client machine
jQuery in Action, 3rd edition