2011-08-06 219 views
1

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");} 
      }); 

这是真实的文件是否转移。

in Allcammand.aspx如何获取文件?????

+1

[JQuery Ajax File Upload]的可能重复(http://stackoverflow.com/questions/2320069/jquery-ajax-file-upload) – Quentin

回答