Article from Uploadify extended configuration using http://www.wuyinweb.com/doc/52/57.aspx
In the project involved in the multi-file upload, after screening, chose the uploaidify, but also involves a problem, that is, the uploaded files can be categorized, and do not want to add more than one Uploaidify control on the page, so a little modification
Effects such as
Specific transformation Code main code
<DivID= "Uploadbox"> <Divclass= "Ops"> <inputtype= "File"name= "Uploadify"ID= "Uploadify" /> <inputtype= "button"ID= "Btnupload"value="" /> <inputtype= "button"ID= "Btncancel"value="" /> </Div> <DivID= "Filequeue"></Div> </Div><!--File Type box -<Select> <Asp:repeaterrunat= "Server"ID= "Reptypes"> <ItemTemplate> <optionvalue= ' <%#Eval ("id")%>' ><%# Eval("Vc_typename") %></option> </ItemTemplate> </Asp:repeater> </Select>
JS Aspect
$ (document). Ready (function () { $("#uploadify"). Uploadify ({swf:' Theuploadify/uploadify.swf ', uploader:' theuploadify/upload.aspx?id= ' +<%=id%> + ' &dataid= ' +<%=dataid%> + ', cancelimg:' Theuploadify/cancel.png ', FormData: {' Folder ': ' UploadFile '}, Progressdata:' Speed ', Filesizelimit:' 10000KB ', Queueid:' Filequeue ', Auto:false, Multi:true, Height:27, Buttonimage:' Theuploadify/selectfile.jpg ', Wmode:' Transparent ', Onuploadcomplete:function(event, Queueid, Fileobj, response, data) {//alert (fileobj.name); file Upload successful}, OnError:function(event, Queueid, fileobj) {alert ("File:" + fileobj.name + "Upload failed"); }, Onuploadstart:function(file) {//******** can find every entry according to File.id varAttachtype = $ ("#" + file.id). Find ("select"). Val (); This. addPostParam ("Attach_type", Attachtype); This. addPostParam ("file_name", encodeURI (File.name));//to add a filename parameter to the Onuploadstart event}, Onqueuecomplete:function () { //refresh when all uploads are completeWindow.location.href =window.location.href; }, Ondialogclose:function () { varAttachtypes = $ ("#attachTypes"); //Clone file Types varItems = $ (". FileName"); if(Items.length > 0) {Items.each (function () { varNowitem = $ ( This); if(Nowitem.parent (). Find ("select"). Length < 1) { varClonetypes =Attachtypes.clone (); Clonetypes.removeattr ("id"); Clonetypes.insertafter (Nowitem); } }); } } }); //Start uploading$ ("#btnUpload"). Click (function () { $("#uploadify"). Uploadify (' upload ', ' * '); }); //Cancel Upload$ ("#btnCancel"). Click (function () { $("#uploadify"). Uploadify (' Cancel ', ' * '); }); });
The main principle is that when the Select Text dialog box is closed, the corresponding Ondialogclose event is triggered, and the type is added to the specified position of the entry
Uploadif to do a little expansion use