1.ajaxfileupload upload will have the following problems:
2. There are a lot of solutions online, here, I found a kind of, maybe your mistake will be caused by this reason
------ Reason: You do not have a data format string returned to the foreground in a generic handler
3. An example is given below:
1 Front Desk:2 <styletype= "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 <spanclass= "FL filelink"style= "padding-left:10px;">Select File<inputtype= "File"ID= "Uploadify"name= "Uploadify"value= "Upload Data" /></span>8 <Scriptsrc=".. /.. /plugins/jquery/jquery-1.7.2.min.js "type= "Text/javascript"></Script>9 <Scriptsrc=".. /.. /plugins/ajaxfileupload.js "type= "Text/javascript"></Script>Ten One <Script> A $("#uploadify"). On (" Change", function () { - //var file = $ ("#uploadify") [0].files[0]; - $.ajaxfileupload ({ the URL:'./importdynamic.ashx', - Fileelementid:'uploadify', - DataType:'text', - Success:function(data, status) { + Alert (1); - }, + Error:function () { } A }); at }); - </Script> - - General handlers: - context. Response.ContentType = "Text/plain"; - var filePath = "Uploadfile/xxx.xls"; in FilePath = context. Server.MapPath (FilePath); - Import.getcommonreportfile (filePath); toContext. Response.Write ("Return text data, otherwise the foreground will be reported as above error");
4. Plugin: http://files.cnblogs.com/files/namedL/ajaxfileupload.js
(ajaxfileupload) Ajaxfileupload The connection reset issue when uploading