Php instance multi-File Upload instance code

Source: Internet
Author: User

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


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.