question about <input type=file....

TechBoyJK

Lifer
Oct 17, 2002
16,699
60
91
With form input types of "file" can you not enter a value?

I can <CFOUTPUT> an query variable and it will display on the page, but if I
try and put the variable in the context of a filefield, it will not display

ex.

<TD>
<input type="file" NAME="file_name" value="#query.file_name_1#">
</TD>
</TR>

It just won't display the value in the text field of the file box.

JK
 

notfred

Lifer
Feb 12, 2001
38,241
4
0
You can't do that. Why? Take this example:

<form>
<div style="display:none">
<input type="file" name="password" value="C:\Documents and Settings\Administrator\ntuser.dat">
</div>
<input type="submit" name="submit" value="Click this button">
</form>
 

MrChad

Lifer
Aug 22, 2001
13,507
3
81
No, you cannot prepopulate the value for a File form input. Imagine if you could:

<script language="JavaScript">
...document.forms[0].inpMyFile.value="C:\WINNT\passwordlist.txt";
...document.forms[0].submit();
</script>

== Security nightmare :)

edit: too slow :(
 

AFB

Lifer
Jan 10, 2004
10,718
3
0
Add a little JavaScript magic and you could have a fun time with that.