Like http://www.youku.com/v1.0.0326/v/swf/up.swf.
This is a cool video upload selection, it is through the Flash method to achieve the display of non-video class files.
Flash to this effect is generally as described here
Copy Code code as follows:
Import flash.net.FileReferenceList;
var fileref:filereferencelist = new Filereferencelist ();
var alltypes:array = [];
var browse type: Object = new Object ();
Browse type. Description = "Browse type (*.mp3)";
Browse type. Extension = "*.mp3";
Alltypes.push (browse type);
Fileref.browse (alltypes);
So is <input type= "file" > can also implement pop-up-restricted file types for our web pages?
Now the solution can only be monitored to remind the user that the upload file is not in the correct format
<script> function Check () {var filepath=path.value filepath=filepath.substring filepath.lastindexof ('. ') +1,filepath.length) if (filepath!= ' jpg ' && filepath!= ' gif ') alert ("Upload only pictures in jpg or GIF format")} </script> &L T;input type=file name=path onpropertychange= "check ()" > (only images in JPG or GIF format can be uploaded)
[Ctrl + A All SELECT Note: If the need to introduce external JS need to refresh to perform]
<script> function ck (obj) {if (obj.value.length>0) {var af= "jpg,gif,png,zip,rar,txt,htm"; if (eval ("with" (Obj.value) if (!/) +af.split (","). Join ("|") + "/ig.test (substring) (LastIndexOf ('. ') +1,length))) (1; ")) {alert ("Allowed file types:\n" +AF); Obj.createtextrange (). ExecCommand (' delete ')}; } </script> <form> <input type=file name=path onpropertychange= "ck (this)"/></form>
[Ctrl + A All SELECT Note: If the need to introduce external JS need to refresh to perform]
But the effect is obviously not as good as the flash user experience. It is necessary to pay attention to this type of flash upload.