JavaScript 有关file类型的知识点
1.规定上传文件的类型
ValidAcceptTypes:ForCSVfiles(.csv),use:<inputtype="file"accept=".csv"/>ForExcelFiles2003-2007(.xls),use:<inputtype="file"accept="application/vnd.ms-excel"/>ForExcelFiles2010(.xlsx),use:<inputtype="file"accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"/>ForTextFiles(.txt)use:<inputtype="file"accept="text/plain"/>ForImageFiles(.png/.jpg/etc),use:<inputtype="file"accept="image/*"/>ForHTMLFiles(.htm,.html),use:<inputtype="file"accept="text/html"/>ForVideoFiles(.avi,.mpg,.mpeg,.mp4),use:<inputtype="file"accept="video/*"/>ForAudioFiles(.mp3,.wav,etc),use:<inputtype="file"accept="audio/*"/>ForPDFFiles,use:<inputtype="file"accept=".pdf"/>
2.取消“未选择文件”的提示
title=""//设为空
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。