HTML + <input type="File">

B

Bhavin

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 :(
 
R

Ray at

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
 
A

Aaron Bertrand [MVP]

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,169
Latest member
ArturoOlne
Top