消息关闭
    暂无新消息!


 $.ajax({
                type: "post",
                url: "ClassesMien.aspx/UpLoad",
                data: "{data:" + FiledsArry[0].FiledBuffer + "}", //FiledsArry[0].FiledBuffer是通过FileReader.readAsArrayBuffer获取到的二进制
                datatype: "binary",
                contentType: "application/json",
                success: function (data) {
                    alert(22222);
                },
                error: function (XMLHttpRequest, textStatus, errorThrown) {
                    jMDialog.unLoading();
                    jMDialog.alert(XMLHttpRequest.Message, "错误信息");
                }
            });



  [WebMethod]
        public static string UpLoad(byte[] data)
        {
            return "dasdasdsada";

        }
    }


另外想问的是,能不能直接把 files上传,不通过二进制,而且,ajax有没有上传中的方法做进度条

2个回答

︿ 3
我现在刚知道 fromdata。

现在是正常调到 ashx页面了,


  var fd = new FormData();
            fd.append("user", "1252");
            fd.append("filed", FiledsArry[0].Filed, "sdsada");


            $.ajax({
                type: "post",
                url: "/PubPacket/UpLoadDeal.ashx",
                data: fd,
                datatype: "json",
                processData: false,
                contentType: false,
                success: function (data) {
                    alert(22222);
                },
                error: function (XMLHttpRequest, textStatus, errorThrown) {
                    jMDialog.unLoading();
                    jMDialog.alert(XMLHttpRequest.Message, "错误信息");
                }
            });



但是flies 怎么在ashx获取呢  context.Request.Files是没有值的