Home >Web Front-end >JS Tutorial >Client js determines the file type and file size and limits the upload size_javascript skills

Client js determines the file type and file size and limits the upload size_javascript skills

WBOY
WBOYOriginal
2016-05-16 17:13:371361browse

Due to project needs! A script is needed to determine the size and file type on the client side! It’s so hard to find information online! I simply wrote an example myself and tested the file upload size limit. It is compatible with ie6, ie7, ie8, Google Chrome, ff and other browsers

Copy code The code is as follows:







< input type="file" name="contractFileName" style="width: 500px;" onchange="fileChange(this);"/>


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn