开发者

send file to server

HTML

<input type="file" id="file1" />

SCRIPT

file=$("#file1");

            $.ajax({
  开发者_运维百科           type: "POST",
             url: "Allcammand.aspx?cmd=EnterProduct&idCompany="+getParam("idCompany"),
             type:"post",
             data: {
                 file: file
              },
                async: false ,
                   success: function(response){                                                                   
                    },
                    error:function(xhr, ajaxOptions, thrownError){alert(xhr.responseText); ShowMessage("خطا در انتقال اطلاعات شرکت","fail");}
            });

This is true whether the file transfer.

in Allcammand.aspx how can get file?????


Uploading files via AJAX is a complex process that you probably aren't going to want to write yourself. I'd recommend using something like this: http://jquery.malsup.com/form/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜