PDA

View Full Version : Reading client directories with Javascript


boyd5
06-22-2001, 01:26 AM
Is it possible to read client directories with javascript? I need to find out if a file exists on a client machine.

Thanks for any input.

whkoh
06-22-2001, 01:28 AM
Welcome to htmlforums.

I think you need server-side to accomplish this.

boyd5
06-22-2001, 01:33 AM
Yeah, but a server side script can only read directories on the server itself. If I had an applet, that could read the directory, however, since javascript is client side, I was hoping it could do the same.

If you're aware of a serverside method to accomplish this, I'd truly appreciate it if you could point me in the right direction.

Cheers,
Adam

Dr. Web
06-22-2001, 11:38 AM
you cant directory browse with javascript. JAVA and JavaScript are waaaaaaaaaaaaaaaaay different.

Why do you need to find out if they have a file? You can't just ask them? Or is it a plug in?

boyd5
06-22-2001, 12:21 PM
The problem with java is that unless it's a client-side applet, you can't read user information. JSP for example, runs on the server, and can only keep session and cookie data describing the users settings.

I want to be able to check to see if a user has a media file, and then play it from their desktop, instead of forcing a download.

Any ideas?

-Adam

Dr. Web
06-22-2001, 01:21 PM
Hmmmn, how many people will already have the media file? And then how long would it take to find it (assuming you could search)?

I think just linking to it, with filesize info is a good option. I mean, if they already have it.... they most likely have already seen it. If its a big file..... they might have watched it, then deleted it.

I think its redundant to play a media file that someone has seen before. I mean, how many people download it.... but don't watch it?

You really need to ask: Do I need to show the media file? or is it optional.

I know you can detect plug ins.... but specific files located anywhere on a pc? Don't think so.

boyd5
06-22-2001, 01:41 PM
This is part of a training program. The program has mp3's played through flash. It also has video files (avi's) that can be played by the user. The idea is to give them the capability of bypassing the download, by reading the file off of the harddrive instead.

But how do I know if they have the file... not really sure about that. Cookies are one of the options. I thought perhaps javascript could browse the client directory.

I hope this helps to clarify this issue.

Dr. Web
06-22-2001, 02:49 PM
still, you cant go browsing with JS. Cant. Wont. Its a security hazard. Trying to access files on a users machine, with a script. Your not going to get anywhere like that. Cookies? How will they help? You create the cookies, and if they download the movie, then you can set the cookie to true. Ok, but then how do you access a file on a users PC when viewing a web page? Its a security hazard.

Imagine someone with the capeability to access the contents of your hard drive, and run/ execute any program..... people who make executible files which are downloaded onto the client machine.

You can look into VB/ Java applications that are downloaded, search for the file, and play it if it is present. They will not execute automatically from the webpage. The user will always have the option to download/ cancel.

Dr. Web
06-22-2001, 02:53 PM
why not make this training program onto a CD, and send it out? Then there is no need to check for the video... because it is present, and can be run directly from the cd. Also the downloading is bypassed since the video is stored on the cd. No need for long downloads ever.




One final note: Video on the web takes along time to download, no matter whether they download it for immediate viewing, or for future reference. Your files will probably be very long, and HUGE filesize. Are you sure these users would even bother with a 4hour download for 1 video file? If they really need to see the video, I'd consider putting the training with video on a cd. They hold something like 750mb of data.