This article is a mirror article of machine translation, please click here to jump to the original article.

View: 11051|Reply: 0

[HTML/HTML5] html file upload box input tag

[Copy link]
Posted on 6/27/2016 5:58:09 PM | | |

File upload box
Sometimes, when the user is required to upload their own files, the file upload box looks similar to other text fields, except that it also contains a browse button. Visitors can select the file they want to upload by entering the path to upload or by clicking the browse button. Code format: <input type="file" name="..." size="15" input enctype="multipart/form-data" maxlength="100"> Attribute explanation: Attribute explanation: type="file" defines the file upload box; name attribute defines the name of the file upload box, and a unique name must be defined to ensure accurate data collection; size attribute defines the width of the file upload box, in units of individual character width; maxlength attribute defines the maximum number of characters to be entered.
Note:
To make the file upload successful, do the following:

INPUT type=file element must appear inside the FORM element.
The INPUT type=file element must be given a value for the NAME tag property.
The value of the FORM element METHOD tag property must be set to post.
The value of the ENCTYPE tag property of the FORM element must be set to multipart/form-data.




Previous:Secondary encapsulation of Baidu WebUploader open source upload control, streamlining the front-end code (two sentences of code to get the upload)
Next:asp.net 404 error when uploading large files in mvc
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com