By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,483 Members | 963 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,483 IT Pros & Developers. It's quick & easy.

file tag problem??????????

dmjpro
100+
P: 2,476
i have <input name = "" type = file>

the page shows the file upload control but can't i assign the intial value to be shown in the text box of the file upload control



thanx in advance
Feb 13 '07 #1
Share this Question
Share on Google+
5 Replies

100+
P: 428
input type=file is read only.
Feb 13 '07 #2

acoder
Expert Mod 15k+
P: 16,027
This is not supported by most browsers. Read here.
Feb 13 '07 #3

dmjpro
100+
P: 2,476
thanx for ur reply

i understand that for security reasons it is not allowed
but can anyone tell me ....
the text box which appeared is not readonly if user enters manually instead of selecting the file without browsing ...
then what is the security.....


again thanx in advance
Feb 14 '07 #4

dmjpro
100+
P: 2,476
finally i managed to do so ..

i tried the code ...


<input type = file name = "" onkeypress = "return false" onkeydown = "return false" onkeyup = "return false">

that stops the user to enter the file location manually ..
only user can enter the file name by browsing
Feb 14 '07 #5

acoder
Expert Mod 15k+
P: 16,027
I misunderstood your problem. Yes, that was asked earlier. Just to clarify, the reason why most browsers don't allow an initial value is that if you can set it, it is easy to submit the form on body load which poses a security risk.
Feb 14 '07 #6

Post your reply

Sign in to post your reply or Sign up for a free account.