Php instance multi-File Upload instance code
// A = $ ('<span class = "MultiFile-title" title = "' + MultiFile. STRING. selected. replace ('$ file', v) +' "> '+ MultiFile. STRING. file. replace ('$ file', v. match (/[^/] + $/gi) [0]) + '</span> '),
// This is the new code structure.
// Retrieve the image format.
Ext = String (v. match (/. w {1, 4} $/gi ));
// The v variable is the path address, so you can use img to display it directly.
Var imgs = (ext00000000'.jpg '| ext000000000000'.gif' | ext00000000'.png ')? ' ':'';
// Starting with '+ imgs +', this is what I added.
A = $ ('<span class = "MultiFile-title" title = "' + MultiFile. STRING. selected. replace ('$ file', v) +' "> '+ MultiFile. STRING. file. replace ('$ file', v. match (/[^/] + $/gi) [0]) + '</span>' + imgs + '<a class = "a_ B" href = "javascript :; "title =" click to insert a topic "rsok =" '+ slave_count +' "onclick =" alert ('+ slave_count + '); return false "> click Insert </a> '),
B = $ ('<a class = "MultiFile-remove" href = "#' + MultiFile. wrapID + '">' + MultiFile. STRING. remove + '</a> ');
Copy the Code <! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Transitional // EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<Html xmlns = "http://www.w3.org/1999/xhtml">
<Head>
<Meta http-equiv = "Content-Type" content = "text/html; charset = UTF-8"/>
<Title> untitled document </title>
</Head>
<Script type = "text/javascript" src = "jquery. js"> </script>
<Script type = "text/javascript" src = "jquery. MultiFile. js"> </script>
<Script type = "text/javascript">
<! --
$ (Function (){
// Test whether jquery Loads
// Alert ('jquery ');
// Content in Example 7 Mode
$ ('# T7'). MultiFile ({
List: # T7-list'
});
})
-->
</Script>
<Body style = "font-size: 14px; margin: 10%; height:">
<! -- Create an ID # T7 and set a div as the T7-list to display the content -->
<Input id = "T7" name = "upfile" type = "file"/>
<Div id = "T7-list"> </div>
<Div> some tests: <a href = "javascript:;" onclick = "alert(('{t7-list'{.html ()"> list content </a> </div>
</Body>
</Html>
Copy the code // for editing, the key name and key are calculated from 0, so it is very important to obtain the last rsok value of the attachment.
// Var int_s = $ ('. a_ B: la'). attr ('rsok ');
// Bind functionality to the first element
If (! MultiFile. MultiFile) MultiFile. addSlave (MultiFile. e, 0 );
Copy code