Input file upload Specify a specific file type

Source: Internet
Author: User

If you want to specify a particular file type when you/> This HTML element with <input type= "file", you can write

<input type= "File" accept= ". THB"/>

The type that follows the character can be specified at will, and can be separated by commas if you want to specify more than one type.

<input type= "File" accept= ". THB,. dwg"/>

When you use the upload component of fine uploader, if you need to qualify the file upload type, the method is
var manualuploader = new QQ. Fineuploader ({
      element: $ ("#manual-fine-uploader") [0],
      request: {
        Endpoint:url
      },
      validation : {
          allowedextensions: [' dwg '],
          acceptfiles: '. dwg '
      },
      callbacks: {
        onallcomplete:function () {
          //All files uploaded successfully after
        the call}
      ,
      Template: "Qq-template-manual-noedit",
      autoupload:false
    });

Other can be ignored, just want to see in the validation, so qualified, you can qualify the file type, even if the user selected other formats of the file, the end will prompt the user file format is not correct, because the allowedextensions limited file format.

But IE6 and IE7 do not support, now China with more than 360 browser users, can be specified in the Code 360 speed mode, so that users open the Web page, the default is to use the speed mode to browse, there will be no IE6 and IE7

of the problem. Set the way below

Add a line of code to the head tag

 

Content is the value of one of the Webkit,ie-comp,ie-stand, case-sensitive, respectively, representing the WebKit kernel, ie-compatible kernel, IE standard kernel.
If the page needs to default with the speed core, add Tags: <meta name= "renderer" content= "WebKit" >
If the page need to default with IE compatible kernel, add Tags: <meta name= "renderer" content= "Ie-comp" >
If the page should default to use IE standard kernel, add Tags: <meta name= "renderer" content= "Ie-stand" >




Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.