View Full Version : about <input type=file>
01-13-2004, 04:19 PM
the code is:
<input type="file" name="userFile2" size="80" value="C:\" onkeypress="KeyPress()">
But the "C:\" does not show in the text area. Who knows how to show it.
01-13-2004, 04:25 PM
You can't set the value attribute of file upload form elements for security reasons. Consider this: someone could set the default value to a sensitive file, for example, a password file, then call the form element's submit method (or hide the element and let the user submit the form), and thus uploading senstivie data to the server. By not being able to set the value attribute of these kind of elements prevents this from happening. Moreover, when you select a file from the dialog, it will print the complete path in the textbox (rendering setting the value attribute useless), you also need to consider not everyone uses Windows as their operating system. I, for example, run Red Hat Linux, and there is no such thing as C:\ here.
01-14-2004, 03:35 AM
What fredmv said. The value attribute of file input is read-only.
01-14-2004, 09:12 AM
01-14-2004, 09:17 AM
Yes of course, as long as you don't display it in a file field. Search for cookie-related threads in this forum or google for cookie scripts if you don't have any.
Powered by vBulletin® Version 4.2.2 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.