FileUpload ElementNameFileUpload Element---a file upload field for form inputSynopsis
form.name form.elements[i] Properties
Methods
Event Handlers
HTML SyntaxA FileUpload element is created with a standard HTML <INPUT> tag, with the addition of optional attributes for event handlers:
<FORM ENCTYPE="multipart/form-data" METHOD=post> required attributes ... <INPUT TYPE"file" specifies that this is a FileUpload element [ NAME="name" ] a name that can later be used to refer to this element specifies the name property [ SIZE=integer ] how many characters wide the element is [ MAXLENGTH=integer ] max allowed number of input characters [ onBlur="handler" ] the onblur() event handler [ onChange="handler" ] the onchange() event handler [ onFocus="handler" ] the onfocus() event handler > ... DescriptionThe FileUpload element represents a file upload input element in a form. In many respects, this input element is much like the Text element. On the screen, it appears like a text input field, with the addition of a Browse... button that opens a directory browser. Entering a filename into a FileUpload element (either directly or through the browser) will cause Netscape to submit the contents of that file along with the form. For this to work, the form must use "multipart/form-data" encoding and the POST method. The FileUpload element does not have a defaultValue property, and does not recognize the VALUE HTML attribute to specify an initial value for the input field. Similarly, the value property of the FileUpload element is read-only. Only the user may enter a filename; JavaScript may not enter text into the FileUpload field in any way. This is to prevent malicious JavaScript programs from uploading arbitrary files (such as password files) off of the user's machine. |
|