Click to See Complete Forum and Search --> : checking for local files


kbrown2974
12-12-2003, 09:56 AM
Writing a script that looks for a PDF file on the local system. If the file is found, then it is brought up in a new window. The user enters a file name in field and we look it up that way. Is there a command that will search for a file?

GavinPearce
12-12-2003, 10:08 AM
No sorry, no webbased programming language at all has permissions to search someones local directory.

kbrown2974
12-12-2003, 10:12 AM
I'm confused then. We can pull up a pdf exists on the network. We can't check to see if it does not exist?

pyro
12-12-2003, 10:14 AM
I feel quite certain that ActiveX could do so. ActiveX, however, only runs in IE (which means I don't have to worry about it. :p) and by default is set to disable for everything except signed scripts, which is set to prompt.

kbrown2974
12-12-2003, 10:18 AM
Here is the little bit of code. pdf is document.form.reference.value. No ifexist or anything like that??

if (pdf != "")
{
pdfname = "i:/apps/grid/" + pdf + ".pdf";
winname = pdf + "win";
pdfwin = window.open(pdfname,winname);
pdfwin.focus();
}

GavinPearce
12-12-2003, 10:19 AM
Sorry, my bad, i thought you meant local, as in the visitors actual computer not the website server.


JS wont do it.

PHP will.

GavinPearce
12-12-2003, 10:23 AM
AH u did, ummmm

Well as far as I thought, JavaScript couldn't get within a visitors computer at all.

Ummmm...

Let me do some research.

TheBearMay
12-12-2003, 10:28 AM
You can get around some of the restrictions by changing the file type to HTA (hypertext application) instead of HTML.