AvailabilityJavaScript 1.0 Inherits from Input, HTMLElement Synopsisform.name form.elements[i] PropertiesFileUpload inherits properties from Input and HTMLElement and defines or overrides the following:
To prevent malicious programs from uploading arbitrary files from the client, this property may not be set by JavaScript code. Similarly, the value attribute of the <input> tag does not specify the initial value for this property. MethodsFileUpload inherits methods from Input and HTMLElement. Event HandlersFileUpload inherits event handlers from Input and HTMLElement and defines or overrides the following:
HTML SyntaxA FileUpload element is created with a standard HTML <input> tag: <form enctype="multipart/form-data" method="post"> // Required attributes ... <input type="file" // Specifies that this is a FileUpload element [ name="name" ] // A name you can use later to refer to this element // Specifies the name property [ size="integer" ] // How many characters wide the element is [ maxlength="integer" ] // Maximum 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) causes 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) from the user's machine. See AlsoForm, HTMLElement, Input, Text; HTMLInputElement in the DOM reference section |