Viks said the following on 5/21/2006 6:37 AM:[color=blue]
> Hi everyone,
>
> I am beginner at javascript.One of the web
> applications that i am currently developing,requires to upload file
> from the client side to the server.[/color]
Simple so far.
[color=blue]
> The condition being that the file dailog box(normal windows file
> dailog box) on the client side should open in a specific directory
> only and should filter out files with a specific extension.[/color]
That you can't do.
[color=blue]
> Moreover the relative path of the selected file should be converted
> into UNC path and passed on to the server.[/color]
The path to the file will always be an absolute full path in Windows so
no conversion needed. You just read the .value of the input:
<input type="file" onchange="alert(this.value)">
But, why does it matter where the file is located on the PC?
[color=blue]
> I am not very sure whether javascript can possibly get a hook to the
> file dailog box of the underlying OS(Windows in my case).I tried
> finding some ideas over the net,but none looked convincing.[/color]
You can't. It is a security restriction.
[color=blue]
> Is this possible in javascript?[/color]
No.
[color=blue]
> if not, is there any way that i can acheive this.[/color]
I hope not, for the security issues involved.
--
Randy
comp.lang.javascript FAQ -
http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices -
http://www.JavascriptToolbox.com/bestpractices/