Connecting Tech Pros Worldwide Forums | Help | Site Map

HTML + <input type="File">

Bhavin
Guest
 
Posts: n/a
#1: Jul 19 '05
Hi
I'm trying to set default value for input type file.

<input type="File" name="tx_pdffile" accept="*.pdf"
class="boxText" value="abc.pdf">

but this value (abc.pdf) doesnt appear in the text box..

Whats the solution???

Bhavin :(

Ray at
Guest
 
Posts: n/a
#2: Jul 19 '05

re: HTML + <input type="File">


You cannot specify a default value, unless your users are running like
Internet Explorer 1.0 or something. This is a security issue, and you
cannot control this. If this were possible, people would make a form with
<input type=file value=C:\mycreditcardnumbers.txt> and then
document.formname.submit() it onload.

Ray at home

"Bhavin" <anonymous@discussions.microsoft.com> wrote in message
news:04c001c39840$7e4fe540$a501280a@phx.gbl...[color=blue]
> Hi
> I'm trying to set default value for input type file.
>
> <input type="File" name="tx_pdffile" accept="*.pdf"
> class="boxText" value="abc.pdf">
>
> but this value (abc.pdf) doesnt appear in the text box..
>
> Whats the solution???
>
> Bhavin :([/color]


Aaron Bertrand [MVP]
Guest
 
Posts: n/a
#3: Jul 19 '05

re: HTML + <input type="File">


> I'm trying to set default value for input type file.

Nope, can't be done. Thankfully. Your user will have to browse for the
file.



Closed Thread