(Ajaxfileupload) Connection Reset may occur during ajaxfileupload upload. ajaxfileupload

Source: Internet
Author: User
Tags connection reset

(Ajaxfileupload) Connection Reset may occur during ajaxfileupload upload. ajaxfileupload

1. The following problems may occur during ajaxfileupload upload:

 

2. There are a lot of solutions on the Internet. Here I found another one. Maybe your error is caused by this.

------The reason is: you do not return the data format string required by the front-end in the general processing program.

 

3. The following is an example:

 

1 front-end: 2 <style type = "text/css"> 3. fileLink {position: relative; display: inline-block; background: # fff; border: 1px solid #0980D0; border-radius: 4px; padding: 2px 8px; margin-left: 10px; margin-top: 10px; overflow: hidden; color: #1E88C7; text-decoration: none; text-indent: 0; line-height: 20px;} 4. fileLink input {position: absolute; font-size: 100px; right: 0; top: 0; opacity: 0;} 5. fileLink: hover {background: # AADFFD; border-color: #78C3F3; cursor: pointer; color: #004974; text-decoration: none ;} 6 </style> 7 <span class = "fL fileLink" style = "padding-left: 10px; "> select <input type =" file "id =" uploadify "name =" uploadify "value =" Upload data "/> </span> 8 <script src = ".. /.. /Plugins/jquery/jquery-1.7.2.min.js "type =" text/javascript "> </script> 9 <script src = ".. /.. /Plugins/ajaxfileupload. js "type =" text/javascript "> </script> 10 11 <script> 12 $ (" # uploadify "). on ("change", function () {13 // var file = $ ("# uploadify") [0]. files [0]; 14 $. ajaxFileUpload ({15 url :'. /ImportDynamic. ashx ', 16 fileElementId: 'uploadify', 17 dataType: 'text', 18 success: function (data, status) {19 alert (1); 20}, 21 error: function () {}22}); 23}); 24 </script> 25 26 general handler: 27 context. response. contentType = "text/plain"; 28 var filePath = "uploadfile/xxx.xls"; 29 filePath = context. server. mapPath (filePath); 30 Import. getCommonReportFile (filePath); 31 // context. response. write ("return text data, otherwise the foreground will report the above error ");

 

4. Plug-In: http://files.cnblogs.com/files/namedL/ajaxfileupload.js

 

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.