Home > Web Front-end > JS Tutorial > js determines the uploaded file type and determines the FileUpload file type code_javascript skills

js determines the uploaded file type and determines the FileUpload file type code_javascript skills

WBOY
Release: 2016-05-16 16:47:36
Original
1343 people have browsed it

HTML tag code in asp.net:

Copy code The code is as follows:




Common html tags:
Copy code The code is as follows:




For ASP.NET or ordinary HTML tags, the following JS code is applicable:
Copy code Code As follows:

function CheckWorkFile()
{
var obj=document.getElementById('fuMain');
if(obj.value=='')
{
alert('Please select the assignment book file to upload');
return false;
}
var stuff=obj.value.match(/^(.*)(.)( .{1,8})$/)[3];
if(stuff!='doc')
{
alert('The file type is incorrect, please select the .doc file');
return false;
}
return true;
}
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template