liamthebof Posted May 9, 2009 Share Posted May 9, 2009 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. Quote Link to comment https://forums.phpfreaks.com/topic/157522-file-exists-on-user-pc/ Share on other sites More sharing options...
Ken2k7 Posted May 9, 2009 Share Posted May 9, 2009 Uh NO! That would be a *HUGE* security flaw. Quote Link to comment https://forums.phpfreaks.com/topic/157522-file-exists-on-user-pc/#findComment-830508 Share on other sites More sharing options...
Daniel0 Posted May 9, 2009 Share Posted May 9, 2009 Java can do it. Quote Link to comment https://forums.phpfreaks.com/topic/157522-file-exists-on-user-pc/#findComment-830513 Share on other sites More sharing options...
Ken2k7 Posted May 9, 2009 Share Posted May 9, 2009 Java can do it. Java is a web scripting language? Quote Link to comment https://forums.phpfreaks.com/topic/157522-file-exists-on-user-pc/#findComment-830515 Share on other sites More sharing options...
Daniel0 Posted May 9, 2009 Share Posted May 9, 2009 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. Quote Link to comment https://forums.phpfreaks.com/topic/157522-file-exists-on-user-pc/#findComment-830526 Share on other sites More sharing options...
.josh Posted May 10, 2009 Share Posted May 10, 2009 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. Quote Link to comment https://forums.phpfreaks.com/topic/157522-file-exists-on-user-pc/#findComment-830644 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.