For jquery1.11.1 ajaxfileupload. js, jquery1.11.1

Source: Internet
Author: User

For jquery1.11.1 ajaxfileupload. js, jquery1.11.1

Ajaxfileupload source code

Solve the problem that success is not taken after the upload is successful.

Solve compatibility problems of jquery in later versions

JQuery. extend ({


CreateUploadIframe: function (id, uri)
{
// Create frame
Var frameId = 'juploadframe '+ id;
Var iframeHtml = '<iframe id = "' + frameId + '" name = "' + frameId + '"> with html code and server code

 

<Input type = "file" id = "importFile" name = "importFile" accept = "text/plain" style = "display: none"/>

 

 

# Region Upload File Read imported content
Public JsonResult Upload ()
{
HttpFileCollectionBase HFCs = Request. Files;
String Path = "";
List <LgtdAndLttd> list = new List <LgtdAndLttd> ();
String PhysicalPath = "";
If (hfc-count> 0)
{
If (HFCs [0]. FileName. Contains ("\\"))
{
Int index = HFCs [0]. FileName. LastIndexOf ('\\');
Path = "/Upload" + hfc[ 0]. FileName. Substring (index, hfc[ 0]. FileName. Length-index );
}
Else
Path = "/Upload/" + System. dateTime. now. toString ("yyyy-MM-dd HH: mm: ss: ffff") + System. IO. path. getFileName (hfc[ 0]. fileName );
PhysicalPath = Server. MapPath (Path );
HFCs [0]. SaveAs (PhysicalPath );
StreamReader sr = new StreamReader (PhysicalPath );
LgtdAndLttd sta = new LgtdAndLttd ();
While (sr. Peek ()> = 0)
{
Sta. LGTD = sr. ReadLine (). Split ('|') [0];
Sta. LTTD = sr. ReadLine (). Split ('|') [1];
List. Add (sta );
}
}
Return Json (list );
}
# Endregion

 

Related Article

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.