您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

AjaxFileupload 上传时出现连接重置该怎么办?

2025/10/26 19:23:11发布22次查看
这篇文章主要介绍了解决ajaxfileupload 上传时会出现连接重置的问题,需要的朋友可以参考下
1.ajaxfileupload 上传时会出现如下问题:
2. 网上有很多的解决办法,在这里,我又发现了一种,可能你的错误会是这个原因引起的
------原因是 : 你在一般处理程序中没有返回前台需要的数据格式字符串
3.下面给出一个例子:
前台:
<style type="text/css"> .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;} .filelink input {position: absolute;font-size: 100px;right: 0;top: 0;opacity: 0;} .filelink:hover {background: #aadffd;border-color: #78c3f3;cursor:pointer;color: #004974;text-decoration: none;} </style> <span class="fl filelink" style="padding-left: 10px;">选择文件<input type="file" id="uploadify" name="uploadify" value="上传数据" /></span> <script src="../../plugins/jquery/jquery-1.7.2.min.js" type="text/javascript"></script> <script src="../../plugins/ajaxfileupload.js" type="text/javascript"></script> <script> $("#uploadify").on("change", function () { //var file = $("#uploadify")[0].files[0]; $.ajaxfileupload({ url: './importdynamic.ashx', fileelementid: 'uploadify', datatype: 'text', success: function (data, status) { alert(1); }, error: function () { } }); }); </script> 一般处理程序: context.response.contenttype = "text/plain"; var filepath = "uploadfile/xxx.xls"; filepath = context.server.mappath(filepath); import.getcommonreportfile(filepath); //context.response.write("返回文本数据,否则前台就会报如上错误");
4.插件:files.cnblogs.com/files/namedl/ajaxfileupload.js
以上就是ajaxfileupload 上传时出现连接重置该怎么办?的详细内容。
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product