Jump to content

Recommended Posts

Hello again.

 

I was wondering, is there any way in any web scripting language to make a script capable of detecting whether a use has a certain file on there pc based on the directory you supply in the script?

 

I've checked file-exists but as I know, that only checks the host. I was wondering if maybe there would be a javascript 'hack' using the browse box without displaying it. Im not sure really, so I have posted in the PHP forum as it's the language im most familiar with.

 

Thanks.

Link to comment
https://forums.phpfreaks.com/topic/157522-file-exists-on-user-pc/
Share on other sites

Person A: Which train should I take from New York to Moscow?

Person B: There are no trains from New York to Moscow?

Person C: You could take a plane.

 

Did person C say that planes are trains? However, if you want to be a smartass, Java can be used to write web pages using servlets running on e.g. Apache Tomcat or GlassFish. In this case I'm of course talking about Java applets which are running on the client computer though.

The point Daniel was making is that no, there is no way for a server-side language to directly check if a file exists on the user's computer.  Javascript has limited capabilities for this, but user has to have permissions set to allow for it.  Also, as Dan pointed out, you can use Java to make an applet (or similar item, like an ActiveX control).  But that involves the user allowing it to run and giving it permission to do it.  So basically to make a long story short, no, there is nothing available for a server to just check what's on a user's computer without them knowing.

 

And no, javascript cannot somehow utilize a form file field (the "browse" button thing you mentioned). It is programmed not to be able to.

 

If you're trying to be sneaky about it, I suggest you write some applet or activeX control or some browser addon or some stand-alone app that's novel or hip or "useful" and get the user to click on some ToS with really fine print very obscurely written, that says your little "widget" can/will do something like that.  That is, if you have no problem sleeping at night doing that sort of thing.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.